diff options
author | John Hawthorn <john.hawthorn@gmail.com> | 2011-01-12 15:18:45 -0800 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-02-06 18:45:42 -0200 |
commit | a3f5d7159d00a0c7c7d79d15652028ac13df30af (patch) | |
tree | 53b18592ac740b729ba6a6ff855c145182f52458 /railties/test | |
parent | 10cab35d3b9e87e4b182162f7783c220cf2a937f (diff) | |
download | rails-a3f5d7159d00a0c7c7d79d15652028ac13df30af.tar.gz rails-a3f5d7159d00a0c7c7d79d15652028ac13df30af.tar.bz2 rails-a3f5d7159d00a0c7c7d79d15652028ac13df30af.zip |
fix db:fixtures:load with FIXTURES specified [#6061 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/rake_test.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 822a6bf032..59e5ef4dee 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -82,5 +82,22 @@ module ApplicationTests assert_match /remove_column\("users", :email\)/, output assert_match /AddEmailToUsers: reverted/, output end + + def test_loading_specific_fixtures + Dir.chdir(app_path) do + `rails generate model user username:string password:string` + `rails generate model product name:string` + `rake db:migrate` + end + + require "#{rails_root}/config/environment" + + # loading a specific fixture + errormsg = Dir.chdir(app_path) { `rake db:fixtures:load FIXTURES=products` } + assert $?.success?, errormsg + + assert_equal 2, ::AppTemplate::Application::Product.count + assert_equal 0, ::AppTemplate::Application::User.count + end end end |