diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-06-10 13:10:41 -0700 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-06-10 13:10:41 -0700 |
commit | bb7e81a56d499fa200216071c98b60deb056bf12 (patch) | |
tree | 36c1b2f16485b21dbc76ad12ed797d766d05c679 /spec/models/info_request_spec.rb | |
parent | 2f4c5ea991976ad9443431609f0274ea128353bb (diff) | |
parent | c8a3fc5cd2c5e24613819747c1ac3e1f65469fbd (diff) |
Merge branch 'hotfix/0.11.0.7' into wdtk
Conflicts:
lib/tasks/temp.rake
spec/models/info_request_spec.rb
Diffstat (limited to 'spec/models/info_request_spec.rb')
-rw-r--r-- | spec/models/info_request_spec.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/models/info_request_spec.rb b/spec/models/info_request_spec.rb index b2f0a20fc..56515bd99 100644 --- a/spec/models/info_request_spec.rb +++ b/spec/models/info_request_spec.rb @@ -564,5 +564,44 @@ describe InfoRequest do end + describe 'when an instance is asked if all can view it' do + + before do + @info_request = InfoRequest.new + end + + it 'should return true if its prominence is normal' do + @info_request.prominence = 'normal' + @info_request.all_can_view?.should == true + end + + it 'should return true if its prominence is backpage' do + @info_request.prominence = 'backpage' + @info_request.all_can_view?.should == true + end + + it 'should return false if its prominence is hidden' do + @info_request.prominence = 'hidden' + @info_request.all_can_view?.should == false + end + + it 'should return false if its prominence is requester_only' do + @info_request.prominence = 'requester_only' + @info_request.all_can_view?.should == false + end + end + + describe 'when working out a subject for a followup emails' do + + it "should not be confused by an nil subject in the incoming message" do + ir = info_requests(:fancy_dog_request) + im = mock_model(IncomingMessage, + :subject => nil, + :valid_to_reply_to? => true) + subject = ir.email_subject_followup im + subject.should match(/^Re: Freedom of Information request.*fancy dog/) + end + + end end |