diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-03-13 17:43:33 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-03-13 17:44:24 +0000 |
commit | 0ec573f4c5705ecce51ebe637750301fa57e3d1f (patch) | |
tree | ed1d18a6539f697fcd18aec6007f5d096628b327 /spec/mailers/info_request_batch_mailer_spec.rb | |
parent | 5a435dfcb699b4f7b7d431cafc479ad92dcd6060 (diff) |
Rename spec files so they're run by rake spec.
Diffstat (limited to 'spec/mailers/info_request_batch_mailer_spec.rb')
-rw-r--r-- | spec/mailers/info_request_batch_mailer_spec.rb | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/mailers/info_request_batch_mailer_spec.rb b/spec/mailers/info_request_batch_mailer_spec.rb new file mode 100644 index 000000000..19791e163 --- /dev/null +++ b/spec/mailers/info_request_batch_mailer_spec.rb @@ -0,0 +1,35 @@ +require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') + +describe InfoRequestBatchMailer do + + describe 'when sending batch sent notification' do + + before do + @user = FactoryGirl.create(:user) + @info_request_batch = FactoryGirl.create(:info_request_batch) + @public_body = FactoryGirl.create(:public_body) + @unrequestable = [@public_body] + @mail = InfoRequestBatchMailer.batch_sent(@info_request_batch, @unrequestable, @user) + end + + it 'renders the subject' do + @mail.subject.should == 'Your batch request "Example title" has been sent' + end + + it 'renders the receiver email' do + @mail.to.should == [@user.email] + end + + it 'renders the sender email' do + @mail.from.should == ['postmaster@localhost'] + end + + it 'assigns @unrequestable' do + @mail.body.encoded.should match(@public_body.name) + end + + it 'assigns @url' do + @mail.body.encoded.should match("http://test.host/en/c/") + end + end +end |