diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-27 12:28:10 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-09-16 14:03:22 +0100 |
commit | e91443d8fab05b805fa781c701ca8616aeff563f (patch) | |
tree | bd48900ce58866e58f245bf151da1ada8cd50e82 /spec/models/outgoing_message_spec.rb | |
parent | 798ba1a031c162b36bb1b4a61a431c7026fe1223 (diff) |
Move indexed_by_search to MessageProminence
Add some tests that it's working on the outgoing message model.
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 - - |