Skip to content

Commit

Permalink
Added export mailer test
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaguindani committed Jun 26, 2018
1 parent 92a6c60 commit 8df0e1b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/views/export_mailer/export.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<br>
<div>
<%= link_to t(".download_export", :validity => distance_of_time_in_words(@export.created_at, Export.validity.ago)),
download_catalog_admin_export_path(@export.catalog.slug, I18n.locale, @export.id)
download_catalog_admin_export_url(@export.catalog.slug, I18n.locale, @export.id)
%>
</div>
</p>

<p>
<div>
<%= t(".export_logs", :catalog_name => @export.catalog.name) %>
<%= link_to t(".here"), catalog_admin_exports_path(@export.catalog.slug, I18n.locale) %>.
<%= link_to t(".here"), catalog_admin_exports_url(@export.catalog.slug, I18n.locale) %>.
</div>
</p>
12 changes: 9 additions & 3 deletions test/mailers/export_mailer_test.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
require 'test_helper'

class ExportMailerTest < ActionMailer::TestCase
# test "the truth" do
# assert true
# end
test "export" do
export = exports(:one)
mail = ExportMailer.send_message(export)

assert_equal("Catima - requested export is ready", mail.subject)
assert_equal(["[email protected]"], mail.from)
assert_equal(["[email protected]"], mail.to)
assert_match("/one/en/admin/_exports/#{export.id}/download", mail.body.encoded)
end
end

0 comments on commit 8df0e1b

Please sign in to comment.