aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/user_spec.rb
diff options
context:
space:
mode:
authorfrancis <francis>2009-04-22 02:34:55 +0000
committerfrancis <francis>2009-04-22 02:34:55 +0000
commit530bfa90765ee86051208c14c18b0c7894eb6301 (patch)
treeb7a2f69c1f386c685fac8fa49c6454c5686f680c /spec/models/user_spec.rb
parente522cccf0808cfcb814654ede035237ce2ea8499 (diff)
Various test fixes.
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r--spec/models/user_spec.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index bf90ffdfb..db7753469 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -125,29 +125,32 @@ describe User, "when reindexing referencing models" do
@user = User.new(:comments => [@comment], :info_requests => [@request])
end
- it 'should reindex events associated with that user\'s comments' do
+ it 'should reindex events associated with that user\'s comments when URL changes' do
+ @user.stub!(:changes).and_return({'url_name' => 1})
@comment_event.should_receive(:xapian_mark_needs_index)
@user.reindex_referencing_models
end
- it 'should reindex events associated with that user\'s requests' do
+ it 'should reindex events associated with that user\'s requests when URL changes' do
+ @user.stub!(:changes).and_return({'url_name' => 1})
@request_event.should_receive(:xapian_mark_needs_index)
@user.reindex_referencing_models
end
describe 'when no_xapian_reindex is set' do
-
before do
@user.no_xapian_reindex = true
end
- it 'should not reindex events associated with that user\'s comments' do
+ it 'should not reindex events associated with that user\'s comments when URL changes' do
+ @user.stub!(:changes).and_return({'url_name' => 1})
@comment_event.should_not_receive(:xapian_mark_needs_index)
@user.reindex_referencing_models
end
- it 'should not reindex events associated with that user\'s requests' do
- @request_event.should_not_receive(:xapian_mark_needs_index)
+ it 'should not reindex events associated with that user\'s requests when URL changes' do
+ @user.stub!(:changes).and_return({'url_name' => 1})
+ @request_event.should_not_receive(:xapian_mark_needs_index)
@user.reindex_referencing_models
end