Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…er is used. [#5263 state:open]
  • Loading branch information...
commit c544fcc8eb891e9066bae5eb1478c6823b1f6203 1 parent 3b44b52
@rohit rohit authored spastorino committed
Showing with 15 additions and 0 deletions.
  1. +15 −0 railties/test/generators/scaffold_generator_test.rb
View
15 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
Please sign in to comment.
Something went wrong with that request. Please try again.