diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-08-01 17:56:05 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-09-16 12:41:42 +0100 |
commit | a34e6b1e727c05052f3b4056d881622993d1da9a (patch) | |
tree | 64b58c808ccc6b375a41371afe4702497748fc8c /spec/models/incoming_message_spec.rb | |
parent | 86bac5f263be8adbf8a2fd32a558a8f80321fb57 (diff) |
Don't index hidden and requester_only incoming messages.
Diffstat (limited to 'spec/models/incoming_message_spec.rb')
-rw-r--r-- | spec/models/incoming_message_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb index 51df16194..c0a7e5340 100644 --- a/spec/models/incoming_message_spec.rb +++ b/spec/models/incoming_message_spec.rb @@ -112,6 +112,29 @@ describe IncomingMessage, 'when asked if a user can view it' do end +describe 'when asked if it is indexed by search' do + + before do + @incoming_message = IncomingMessage.new + end + + it 'should return false if it has prominence "hidden"' do + @incoming_message.prominence = 'hidden' + @incoming_message.indexed_by_search?.should be_false + end + + it 'should return false if it has prominence "requester_only"' do + @incoming_message.prominence = 'requester_only' + @incoming_message.indexed_by_search?.should be_false + end + + it 'should return true if it has prominence "normal"' do + @incoming_message.prominence = 'normal' + @incoming_message.indexed_by_search?.should be_true + end + +end + describe IncomingMessage, " when dealing with incoming mail" do before(:each) do |