2014-05-25 23:59:03 +02:00
|
|
|
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)
|
2014-06-23 23:39:42 +02:00
|
|
|
assert_equal [Event.last.contact], mail.to
|
2014-05-25 23:59:03 +02:00
|
|
|
assert_equal ["moderateurs@agendadulibre.org"], mail.from
|
|
|
|
assert_match(/Bonjour.*/, mail.body.encoded)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|