aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/info_request_event_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/info_request_event_spec.rb')
-rw-r--r--spec/models/info_request_event_spec.rb31
1 files changed, 23 insertions, 8 deletions
diff --git a/spec/models/info_request_event_spec.rb b/spec/models/info_request_event_spec.rb
index be3ec77c2..428887c8b 100644
--- a/spec/models/info_request_event_spec.rb
+++ b/spec/models/info_request_event_spec.rb
@@ -1,14 +1,29 @@
require File.dirname(__FILE__) + '/../spec_helper'
-describe InfoRequestEvent, " when " do
-
- it "should convert event parameters into YAML and back successfully" do
- ire = InfoRequestEvent.new
- example_params = { :foo => 'this is stuff', :bar => 83, :humbug => "yikes!!!" }
- ire.params = example_params
- ire.params_yaml.should == example_params.to_yaml
- ire.params.should == example_params
+describe InfoRequestEvent do
+
+ describe "when storing serialized parameters" do
+
+ it "should convert event parameters into YAML and back successfully" do
+ ire = InfoRequestEvent.new
+ example_params = { :foo => 'this is stuff', :bar => 83, :humbug => "yikes!!!" }
+ ire.params = example_params
+ ire.params_yaml.should == example_params.to_yaml
+ ire.params.should == example_params
+ end
+
end
+ describe 'when saving' do
+
+ it 'should mark the model for reindexing in xapian if there is no no_xapian_reindex flag on the object' do
+ event = InfoRequestEvent.new(:info_request => mock_model(InfoRequest),
+ :event_type => 'sent',
+ :params => {})
+ event.should_receive(:xapian_mark_needs_index)
+ event.save!
+ end
+
+ end
end