diff options
Diffstat (limited to 'spec/models/outgoing_message_spec.rb')
-rw-r--r-- | spec/models/outgoing_message_spec.rb | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/spec/models/outgoing_message_spec.rb b/spec/models/outgoing_message_spec.rb index 4bd9361a7..1e05e09f1 100644 --- a/spec/models/outgoing_message_spec.rb +++ b/spec/models/outgoing_message_spec.rb @@ -118,6 +118,29 @@ describe OutgoingMessage, " when making an outgoing message" do end + describe 'when asked if it is indexed by search' do + + before do + @info_request = FactoryGirl.create(:info_request) + @outgoing_message = @info_request.outgoing_messages.first + end + + it 'should return false if it has prominence "hidden"' do + @outgoing_message.prominence = 'hidden' + @outgoing_message.indexed_by_search?.should be_false + end + + it 'should return false if it has prominence "requester_only"' do + @outgoing_message.prominence = 'requester_only' + @outgoing_message.indexed_by_search?.should be_false + end + + it 'should return true if it has prominence "normal"' do + @outgoing_message.prominence = 'normal' + @outgoing_message.indexed_by_search?.should be_true + end + + end end @@ -140,5 +163,3 @@ describe IncomingMessage, " when censoring data" do @om.body.should match(/fancy cat/) end end - - |