aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
diff options
context:
space:
mode:
authorHenare Degan <henare.degan@gmail.com>2012-10-03 17:53:38 +1000
committerHenare Degan <henare.degan@gmail.com>2012-10-03 17:53:38 +1000
commit64eb387b83846ead2bbce76c26224533ea24ebc9 (patch)
treee525eb9ef2ad4c36f96f23eb4d65b672199ac711 /spec/models
parentbe96333dafd0fa0623ca4495237c8c6fa5457c14 (diff)
Requires admin attention emails should include a full URL to the admin page of the request so you can click it, not just a relative path
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/request_mailer_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/models/request_mailer_spec.rb b/spec/models/request_mailer_spec.rb
index 84804d4ca..57041b417 100644
--- a/spec/models/request_mailer_spec.rb
+++ b/spec/models/request_mailer_spec.rb
@@ -327,3 +327,18 @@ describe RequestMailer, 'when sending mail when someone has updated an old uncla
end
+describe RequestMailer, 'requires_admin' do
+ it 'body should contain the full admin URL' do
+ user = mock_model(User, :name_and_email => 'Bruce Jones',
+ :name => 'Bruce Jones')
+ info_request = mock_model(InfoRequest, :user => user,
+ :described_state => 'error_message',
+ :title => 'Test request',
+ :url_title => 'test_request',
+ :law_used_short => 'FOI',
+ :id => 123)
+ mail = RequestMailer.deliver_requires_admin(info_request)
+
+ mail.body.should include('http://test.host/admin/request/show/123')
+ end
+end