diff options
Diffstat (limited to 'railties/test/generators/mailer_generator_test.rb')
-rw-r--r-- | railties/test/generators/mailer_generator_test.rb | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/railties/test/generators/mailer_generator_test.rb b/railties/test/generators/mailer_generator_test.rb index 139d6b1421..c501780e7f 100644 --- a/railties/test/generators/mailer_generator_test.rb +++ b/railties/test/generators/mailer_generator_test.rb @@ -10,11 +10,7 @@ class MailerGeneratorTest < Rails::Generators::TestCase run_generator assert_file "app/mailers/notifier.rb" do |mailer| assert_match(/class Notifier < ActionMailer::Base/, mailer) - if RUBY_VERSION < "1.9" - assert_match(/default :from => "from@example.com"/, mailer) - else - assert_match(/default from: "from@example.com"/, mailer) - end + assert_match(/default from: "from@example.com"/, mailer) end end @@ -77,33 +73,14 @@ class MailerGeneratorTest < Rails::Generators::TestCase assert_file "app/mailers/notifier.rb" do |mailer| assert_instance_method :foo, mailer do |foo| - if RUBY_VERSION < "1.9" - assert_match(/mail :to => "to@example.org"/, foo) - else - assert_match(/mail to: "to@example.org"/, foo) - end + assert_match(/mail to: "to@example.org"/, foo) assert_match(/@greeting = "Hi"/, foo) end assert_instance_method :bar, mailer do |bar| - if RUBY_VERSION < "1.9" - assert_match(/mail :to => "to@example.org"/, bar) - else - assert_match(/mail to: "to@example.org"/, bar) - end + assert_match(/mail to: "to@example.org"/, bar) assert_match(/@greeting = "Hi"/, bar) end end end - - def test_force_old_style_hash - run_generator ["notifier", "foo", "--old-style-hash"] - assert_file "app/mailers/notifier.rb" do |mailer| - assert_match(/default :from => "from@example.com"/, mailer) - - assert_instance_method :foo, mailer do |foo| - assert_match(/mail :to => "to@example.org"/, foo) - end - end - end end |