cirandas.net

ref: master

test/unit/mailing_sent_test.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
require_relative "../test_helper"

class MailingSentTest < ActiveSupport::TestCase

  should 'return mailing and person' do
    person = fast_create(Person)
    environment = Environment.default
    mailing = environment.mailings.create(:subject => 'Hello', :body => 'We have some news')

    sent = mailing.mailing_sents.create(:person => person)

    mailing_sent = MailingSent.find(sent.id)
    assert_equal [mailing, person], [mailing_sent.mailing, mailing_sent.person]
  end
end