diff --git a/app/views/mailers/import_mailer/completed.html.erb b/app/views/mailers/import_mailer/completed.html.erb index 0d4ae61d4..72fe3a573 100644 --- a/app/views/mailers/import_mailer/completed.html.erb +++ b/app/views/mailers/import_mailer/completed.html.erb @@ -1,5 +1,5 @@

Your import of <%= @account.name %> is complete!

-

<%= link_to "Go to your account", landing_url(script_name: account.slug) %>

+

<%= link_to "Go to your account", landing_url(script_name: @account.slug) %>

diff --git a/app/views/mailers/import_mailer/completed.text.erb b/app/views/mailers/import_mailer/completed.text.erb index b33da234d..055e89036 100644 --- a/app/views/mailers/import_mailer/completed.text.erb +++ b/app/views/mailers/import_mailer/completed.text.erb @@ -1,3 +1,3 @@ Your import of <%= @account.name %> is complete! -Here's the URL: <%= landing_url(script_name: account.slug) %> +Here's the URL: <%= landing_url(script_name: @account.slug) %> diff --git a/test/mailers/import_mailer_test.rb b/test/mailers/import_mailer_test.rb new file mode 100644 index 000000000..0acff9bfb --- /dev/null +++ b/test/mailers/import_mailer_test.rb @@ -0,0 +1,15 @@ +require "test_helper" + +class ImportMailerTest < ActionMailer::TestCase + test "completed" do + email = ImportMailer.completed(identities(:david), accounts(:"37s")) + + assert_emails 1 do + email.deliver_now + end + + assert_equal [ "david@37signals.com" ], email.to + assert_equal "Your Fizzy account import is done", email.subject + assert_match accounts(:"37s").slug, email.body.encoded + end +end