Commit ce1de32cecb3131ab3815341d30908620cb42fe7
1 parent
db3c3259
Exists in
master
and in
29 other branches
rails3: Fix MailingJob unit test
Showing
1 changed file
with
7 additions
and
2 deletions
Show diff stats
test/unit/mailing_job_test.rb
... | ... | @@ -11,12 +11,17 @@ class MailingJobTest < ActiveSupport::TestCase |
11 | 11 | |
12 | 12 | should 'create delayed job' do |
13 | 13 | assert_difference Delayed::Job, :count, 1 do |
14 | - mailing = EnvironmentMailing.create(:source_id => environment.id, :subject => 'Hello', :body => 'We have some news', :person => @person_1) | |
14 | + mailing = @environment.mailings.build(:subject => 'Hello', :body => 'We have some news') | |
15 | + mailing.person = @person_1 | |
16 | + mailing.save! | |
15 | 17 | end |
16 | 18 | end |
17 | 19 | |
18 | 20 | should 'change locale according to the locale informed' do |
19 | - mailing = EnvironmentMailing.create(:source_id => environment.id, :subject => 'Hello', :body => 'We have some news', :locale => 'pt', :person => @person_1) | |
21 | + mailing = @environment.mailings.build(:subject => 'Hello', :body => 'We have some news') | |
22 | + mailing.locale = 'pt' | |
23 | + mailing.person = @person_1 | |
24 | + mailing.save! | |
20 | 25 | Noosfero.expects(:with_locale).with('pt') |
21 | 26 | process_delayed_job_queue |
22 | 27 | end | ... | ... |