diff options
author | rohit <rohit.arondekar@gmail.com> | 2010-08-02 13:42:35 +0530 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2010-08-02 10:55:05 -0300 |
commit | c544fcc8eb891e9066bae5eb1478c6823b1f6203 (patch) | |
tree | aed63662f95b43f511287326f9d322a7d113f8dd /railties/test | |
parent | 3b44b52fb0f09e437645d12d2feb6b6d37a804ee (diff) | |
download | rails-c544fcc8eb891e9066bae5eb1478c6823b1f6203.tar.gz rails-c544fcc8eb891e9066bae5eb1478c6823b1f6203.tar.bz2 rails-c544fcc8eb891e9066bae5eb1478c6823b1f6203.zip |
Failing test to check for route file corruption if legacy map parameter is used. [#5263 state:open]
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/generators/scaffold_generator_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb index ea469cb3c8..f12445ae35 100644 --- a/railties/test/generators/scaffold_generator_test.rb +++ b/railties/test/generators/scaffold_generator_test.rb @@ -216,4 +216,19 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase # Stylesheets (should not be removed) assert_file "public/stylesheets/scaffold.css" end + + def test_scaffold_generator_on_revoke_does_not_mutilate_legacy_map_parameter + run_generator + + # Add a |map| parameter to the routes block manually + route_path = File.expand_path("config/routes.rb", destination_root) + content = File.read(route_path).gsub(/\.routes\.draw do/) do |match| + "#{match} |map|" + end + File.open(route_path, "wb") { |file| file.write(content) } + + run_generator ["product_line"], :behavior => :revoke + + assert_file "config/routes.rb", /\.routes\.draw do\s*\|map\|\s*$/ + end end |