agenda-libre-ruby/test/mailers/event_mailer_test.rb

17 lines
491 B
Ruby

require 'test_helper'
class EventMailerTest < ActionMailer::TestCase
setup do
ActionMailer::Base.default_url_options[:host] = 'localhost:3000'
end
test "create" do
mail = EventMailer.create(Event.last)
assert_match(/\[Agenda du Libre\] Votre évènement: .* est en attente de modération/, mail.subject)
assert_equal ["to@example.org"], mail.to
assert_equal ["moderateurs@agendadulibre.org"], mail.from
assert_match(/Bonjour.*/, mail.body.encoded)
end
end