Sha256: 5087e9d2c9f05e2ccccdd29e7b304afc450c5ffc7775c605b453bda3cab1c46d
Contents?: true
Size: 1.22 KB
Versions: 17
Compression:
Stored size: 1.22 KB
Contents
require File.dirname(__FILE__) + '/../test_helper' require 'friend_mailer' class FriendMailerTest < ActiveSupport::TestCase context "deliver emails" do def setup ActionMailer::Base.delivery_method = :test ActionMailer::Base.perform_deliveries = true ActionMailer::Base.deliveries = [] @expected = TMail::Mail.new @expected.set_content_type "text", "plain", { "charset" => 'utf-8' } end should "send follow email" do inviter = Factory(:user) invited = Factory(:user) response = FriendMailer.deliver_follow(inviter, invited) assert !ActionMailer::Base.deliveries.empty?, "No email was sent" email = ActionMailer::Base.deliveries.last assert_equal [invited.email], email.to assert_equal [GlobalConfig.from_email], email.from end should "send friend_request email" do inviter = Factory(:user) invited = Factory(:user) response = FriendMailer.deliver_friend_request(inviter, invited) assert !ActionMailer::Base.deliveries.empty?, "No email was sent" email = ActionMailer::Base.deliveries.last assert_equal [invited.email], email.to assert_equal [GlobalConfig.from_email], email.from end end end
Version data entries
17 entries across 17 versions & 1 rubygems