aboutsummaryrefslogtreecommitdiffstats
path: root/spec/mailers/info_request_batch_mailer.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2014-03-04 10:46:46 +0000
committerLouise Crow <louise.crow@gmail.com>2014-03-04 10:46:46 +0000
commitede46dc8dc6c97cdad8c3fcb3bd42ede5c25f395 (patch)
tree44e03358c9fa7ca6826e631d1d3d6c1030b1b0d5 /spec/mailers/info_request_batch_mailer.rb
parent8e911d5bd0e60a0e0e4859868662cc176419d2e3 (diff)
parenta38b2989aebf8d554b7287e18528bed8c9e67d3b (diff)
Merge branch 'release/0.17'0.17
Diffstat (limited to 'spec/mailers/info_request_batch_mailer.rb')
-rw-r--r--spec/mailers/info_request_batch_mailer.rb35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/mailers/info_request_batch_mailer.rb b/spec/mailers/info_request_batch_mailer.rb
new file mode 100644
index 000000000..19791e163
--- /dev/null
+++ b/spec/mailers/info_request_batch_mailer.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