Commit 212e8b0b59314e43a4df748ad8976fe18f8b77fb
1 parent
da02b7f5
Exists in
staging
and in
26 other branches
[rails3] Adjust attr_accessible
Showing
3 changed files
with
6 additions
and
2 deletions
Show diff stats
app/models/mailing.rb
app/models/mailing_sent.rb
test/unit/mailing_sent_test.rb
| ... | ... | @@ -4,8 +4,10 @@ class MailingSentTest < ActiveSupport::TestCase |
| 4 | 4 | |
| 5 | 5 | should 'return mailing and person' do |
| 6 | 6 | person = fast_create(Person) |
| 7 | - mailing = Mailing.create(:source => Environment.default, :subject => 'Hello', :body => 'We have some news') | |
| 8 | - sent = MailingSent.create(:mailing => mailing, :person => person) | |
| 7 | + environment = Environment.default | |
| 8 | + mailing = environment.mailings.create(:subject => 'Hello', :body => 'We have some news') | |
| 9 | + | |
| 10 | + sent = mailing.mailing_sents.create(:person => person) | |
| 9 | 11 | |
| 10 | 12 | mailing_sent = MailingSent.find(sent.id) |
| 11 | 13 | assert_equal [mailing, person], [mailing_sent.mailing, mailing_sent.person] | ... | ... |