Permalink
Browse files

Failing test to check for route file corruption if legacy map paramet…

…er is used. [#5263 state:open]
  • Loading branch information...
1 parent 3b44b52 commit c544fcc8eb891e9066bae5eb1478c6823b1f6203 @rohit rohit committed with spastorino Aug 2, 2010
Showing with 15 additions and 0 deletions.
  1. +15 −0 railties/test/generators/scaffold_generator_test.rb
@@ -216,4 +216,19 @@ def test_scaffold_with_namespace_on_revoke
# 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

0 comments on commit c544fcc

Please sign in to comment.