diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2013-12-22 10:06:12 +0000 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2013-12-22 10:06:12 +0000 |
commit | cbd4bc84afa354e9b4c50d53a0d6deb7141eb15d (patch) | |
tree | 4f6615e1f415460bf9fadc42413333a382ce5101 /railties/test/generators | |
parent | 6f4a556bf51f70090000a18b82ee4fe60730c6b2 (diff) | |
download | rails-cbd4bc84afa354e9b4c50d53a0d6deb7141eb15d.tar.gz rails-cbd4bc84afa354e9b4c50d53a0d6deb7141eb15d.tar.bz2 rails-cbd4bc84afa354e9b4c50d53a0d6deb7141eb15d.zip |
Add comments with urls for email previews
Diffstat (limited to 'railties/test/generators')
-rw-r--r-- | railties/test/generators/mailer_generator_test.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/railties/test/generators/mailer_generator_test.rb b/railties/test/generators/mailer_generator_test.rb index 207628021a..d209801f60 100644 --- a/railties/test/generators/mailer_generator_test.rb +++ b/railties/test/generators/mailer_generator_test.rb @@ -36,12 +36,15 @@ class MailerGeneratorTest < Rails::Generators::TestCase assert_match(/test "foo"/, test) assert_match(/test "bar"/, test) end - assert_file "test/mailers/previews/notifier_preview.rb" do |mailer| - assert_match(/class NotifierPreview < ActionMailer::Preview/, mailer) - assert_instance_method :foo, mailer do |foo| + assert_file "test/mailers/previews/notifier_preview.rb" do |preview| + assert_match(/\# Preview all emails at http:\/\/localhost\:3000\/rails\/mailers\/notifier/, preview) + assert_match(/class NotifierPreview < ActionMailer::Preview/, preview) + assert_match(/\# Preview this email at http:\/\/localhost\:3000\/rails\/mailers\/notifier\/foo/, preview) + assert_instance_method :foo, preview do |foo| assert_match(/Notifier.foo/, foo) end - assert_instance_method :bar, mailer do |bar| + assert_match(/\# Preview this email at http:\/\/localhost\:3000\/rails\/mailers\/notifier\/bar/, preview) + assert_instance_method :bar, preview do |bar| assert_match(/Notifier.bar/, bar) end end @@ -105,8 +108,10 @@ class MailerGeneratorTest < Rails::Generators::TestCase assert_match(/class Farm::Animal < ActionMailer::Base/, mailer) assert_match(/en\.farm\.animal\.moos\.subject/, mailer) end - assert_file "test/mailers/previews/farm/animal_preview.rb" do |mailer| - assert_match(/class Farm::AnimalPreview < ActionMailer::Preview/, mailer) + assert_file "test/mailers/previews/farm/animal_preview.rb" do |preview| + assert_match(/\# Preview all emails at http:\/\/localhost\:3000\/rails\/mailers\/farm\/animal/, preview) + assert_match(/class Farm::AnimalPreview < ActionMailer::Preview/, preview) + assert_match(/\# Preview this email at http:\/\/localhost\:3000\/rails\/mailers\/farm\/animal\/moos/, preview) end assert_file "app/views/farm/animal/moos.text.erb" assert_file "app/views/farm/animal/moos.html.erb" |