spec/model_spec.rb in outoftime-sunspot_rails-0.10.1 vs spec/model_spec.rb in outoftime-sunspot_rails-0.10.2
- old
+ new
@@ -101,10 +101,17 @@
it 'should not return results excluded by search' do
Post.search do
with :title, 'Bogus Post'
end.results.should be_empty
end
+
+ it 'should find ActiveRecord objects with an integer, not a string' do
+ Post.should_receive(:find).with([@post.id.to_i]).and_return([@post])
+ Post.search do
+ with :title, 'Test Post'
+ end.results.should == [@post]
+ end
end
describe 'search_ids()' do
before :each do
@posts = Array.new(2) { Post.create! }.each { |post| post.index }
@@ -266,7 +273,6 @@
end
end
end
-
end