From 45e3ecda924473817a22e88b25b24fb770b5029c Mon Sep 17 00:00:00 2001 From: Seb Bacon Date: Thu, 19 Jan 2012 12:07:55 +0000 Subject: Always show the right search snippet. Fixes #352. --- spec/models/info_request_event_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'spec/models/info_request_event_spec.rb') diff --git a/spec/models/info_request_event_spec.rb b/spec/models/info_request_event_spec.rb index 5423b8da8..63c859007 100644 --- a/spec/models/info_request_event_spec.rb +++ b/spec/models/info_request_event_spec.rb @@ -73,6 +73,13 @@ describe InfoRequestEvent do event.search_text_main.strip.should == "No way! I'm not going to tell you that in a month of Thursdays.\n\nThe Geraldine Quango" end + it 'should get clipped text for incoming messages, and cache it too' do + event = info_request_events(:useless_incoming_message_event) + event.incoming_message_selective_columns("cached_main_body_text_folded").cached_main_body_text_folded.should == nil + event.search_text_main(true).strip.should == "No way! I'm not going to tell you that in a month of Thursdays.\n\nThe Geraldine Quango" + event.incoming_message_selective_columns("cached_main_body_text_folded").cached_main_body_text_folded.should_not == nil + end + end -- cgit v1.2.3