aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/info_request_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/info_request_spec.rb')
-rw-r--r--spec/models/info_request_spec.rb37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb
index a6f877b20..e03bf6856 100644
--- a/spec/models/info_request_spec.rb
+++ b/spec/models/info_request_spec.rb
@@ -648,6 +648,43 @@ describe InfoRequest do
end
+ describe 'when asked who can be sent a followup' do
+
+ before do
+ @info_request = FactoryGirl.create(:info_request_with_plain_incoming)
+ @incoming_message = @info_request.incoming_messages.first
+ @public_body = @info_request.public_body
+ end
+
+ it 'should not include details from a hidden prominence response' do
+ @incoming_message.prominence = 'hidden'
+ @incoming_message.save!
+ @info_request.who_can_followup_to.should == [[@public_body.name,
+ @public_body.request_email,
+ nil]]
+ end
+
+ it 'should not include details from a requester_only prominence response' do
+ @incoming_message.prominence = 'requester_only'
+ @incoming_message.save!
+ @info_request.who_can_followup_to.should == [[@public_body.name,
+ @public_body.request_email,
+ nil]]
+ end
+
+ it 'should include details from a normal prominence response' do
+ @incoming_message.prominence = 'normal'
+ @incoming_message.save!
+ @info_request.who_can_followup_to.should == [[@public_body.name,
+ @public_body.request_email,
+ nil],
+ ['Bob Responder',
+ "bob@example.com",
+ @incoming_message.id]]
+ end
+
+ end
+
describe 'when generating json for the api' do
before do