aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators
diff options
context:
space:
mode:
authorPrathamesh Sonpatki <csonpatki@gmail.com>2013-05-05 11:33:27 +0530
committerPrathamesh Sonpatki <csonpatki@gmail.com>2013-05-05 16:30:09 +0530
commit9e8c4679456680faedef9eda79bc09c7716bca99 (patch)
tree3de2fcc661f07db63b21ab21ca7ce1696785c498 /railties/test/generators
parent227768cbfed31302f6eff892999f1cb281289beb (diff)
downloadrails-9e8c4679456680faedef9eda79bc09c7716bca99.tar.gz
rails-9e8c4679456680faedef9eda79bc09c7716bca99.tar.bz2
rails-9e8c4679456680faedef9eda79bc09c7716bca99.zip
Fixes warning 'method redefined' in scaffold generators tests
- f1805a697831 Redefined 'test_scaffold_generator_no_assets' twice. - Only the last instance of these three definitions of the same method was getting called when the tests were actually running. - This commit changes names of this method so that all three definitions will be called - scaffold.css is not generated by --assets=false switch. - Test was expecting the presence of the file with --assets=false - This issue was not discovered in f1805a697831b because it was redefining the same method twice
Diffstat (limited to 'railties/test/generators')
-rw-r--r--railties/test/generators/scaffold_generator_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb
index e3dc323b24..d5ad978986 100644
--- a/railties/test/generators/scaffold_generator_test.rb
+++ b/railties/test/generators/scaffold_generator_test.rb
@@ -239,21 +239,21 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
assert_file "config/routes.rb", /\.routes\.draw do\s*\|map\|\s*$/
end
- def test_scaffold_generator_no_assets
+ def test_scaffold_generator_no_assets_with_switch_no_assets
run_generator [ "posts", "--no-assets" ]
assert_no_file "app/assets/stylesheets/scaffold.css"
assert_no_file "app/assets/javascripts/posts.js"
assert_no_file "app/assets/stylesheets/posts.css"
end
- def test_scaffold_generator_no_assets
+ def test_scaffold_generator_no_assets_with_switch_assets_false
run_generator [ "posts", "--assets=false" ]
- assert_file "app/assets/stylesheets/scaffold.css"
+ assert_no_file "app/assets/stylesheets/scaffold.css"
assert_no_file "app/assets/javascripts/posts.js"
assert_no_file "app/assets/stylesheets/posts.css"
end
- def test_scaffold_generator_no_assets
+ def test_scaffold_generator_no_assets_with_switch_resource_route_false
run_generator [ "posts", "--resource-route=false" ]
assert_file "config/routes.rb" do |route|
assert_no_match(/resources :posts$/, route)