diff options
author | Prem Sichanugrist <s@sikachu.com> | 2011-04-10 12:38:59 +0800 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2011-04-10 16:47:52 +0800 |
commit | 22a3416298523d5e8ecb432a263e4bee9441e6c5 (patch) | |
tree | ecbe853fa81be36f3452b5b4cb5221086c0fd23b /railties/test/generators/scaffold_controller_generator_test.rb | |
parent | 74960c3976a69b3c7d9aa6bf28edb42ea82df0ce (diff) | |
download | rails-22a3416298523d5e8ecb432a263e4bee9441e6c5.tar.gz rails-22a3416298523d5e8ecb432a263e4bee9441e6c5.tar.bz2 rails-22a3416298523d5e8ecb432a263e4bee9441e6c5.zip |
Add --old-style-hash option to force creating old style hash on Ruby 1.9
That means if you don't like the new syntax, you can pass --old-style-hash to force Rails to generate code with hash rockets.
Diffstat (limited to 'railties/test/generators/scaffold_controller_generator_test.rb')
-rw-r--r-- | railties/test/generators/scaffold_controller_generator_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/test/generators/scaffold_controller_generator_test.rb b/railties/test/generators/scaffold_controller_generator_test.rb index ff82cdb744..c7f45a807d 100644 --- a/railties/test/generators/scaffold_controller_generator_test.rb +++ b/railties/test/generators/scaffold_controller_generator_test.rb @@ -133,4 +133,11 @@ class ScaffoldControllerGeneratorTest < Rails::Generators::TestCase end end end + + def test_force_old_style_hash + run_generator ["User", "--old-style-hash"] + assert_file "app/controllers/users_controller.rb" do |content| + assert_match /\{ render :action => "new" \}/, content + end + end end |