diff options
Diffstat (limited to 'railties/test/generators/scaffold_generator_test.rb')
-rw-r--r-- | railties/test/generators/scaffold_generator_test.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/railties/test/generators/scaffold_generator_test.rb b/railties/test/generators/scaffold_generator_test.rb index f4f0147156..2710ef7dfd 100644 --- a/railties/test/generators/scaffold_generator_test.rb +++ b/railties/test/generators/scaffold_generator_test.rb @@ -64,8 +64,14 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase assert_file "test/functional/product_lines_controller_test.rb" do |test| assert_match(/class ProductLinesControllerTest < ActionController::TestCase/, test) - assert_match(/post :create, product_line: { title: @product_line.title }/, test) - assert_match(/put :update, id: @product_line, product_line: { title: @product_line.title }/, test) + + if RUBY_VERSION < "1.9" + assert_match(/post :create, :product_line => \{ :title => @product_line.title \}/, test) + assert_match(/put :update, :id => @product_line, :product_line => \{ :title => @product_line.title \}/, test) + else + assert_match(/post :create, product_line: \{ title: @product_line.title \}/, test) + assert_match(/put :update, id: @product_line, product_line: \{ title: @product_line.title \}/, test) + end end # Views @@ -94,8 +100,14 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase assert_file "test/functional/product_lines_controller_test.rb" do |content| assert_match(/class ProductLinesControllerTest < ActionController::TestCase/, content) assert_match(/test "should get index"/, content) - assert_match(/post :create, product_line: { }/, content) - assert_match(/put :update, id: @product_line, product_line: { }/, content) + + if RUBY_VERSION < "1.9" + assert_match(/post :create, :product_line => \{ \}/, content) + assert_match(/put :update, :id => @product_line, :product_line => \{ \}/, content) + else + assert_match(/post :create, product_line: \{ \}/, content) + assert_match(/put :update, id: @product_line, product_line: \{ \}/, content) + end end end |