aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/info_request_event_spec.rb
diff options
context:
space:
mode:
authorlouise <louise>2009-04-14 11:04:52 +0000
committerlouise <louise>2009-04-14 11:04:52 +0000
commit1b306cc7e959cf69a0f3e5a388522a240c770cd9 (patch)
treeece1fd53152c4084efb613494dcf0bbeec3af2cf /spec/models/info_request_event_spec.rb
parent57b0fc86d03fe2ecf1036d6453391c4763eba6b4 (diff)
Allowing xapian reindexing to be skipped if a no_xapian_reindex flag is set on the model
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