Permalink
Browse files

Add test coverage for find_by methods that return no results.

  • Loading branch information...
1 parent e1d12c7 commit 8f80bab968c66f85906e1dfee27490d41c9e2f13 @braintreeps braintreeps committed Apr 3, 2012
Showing with 20 additions and 0 deletions.
  1. +20 −0 spec/curator/repository_spec.rb
@@ -59,6 +59,26 @@
end
end
+ context "find_by_index" do
+ it "returns empty array if not found" do
+ repository = test_repository do
+ indexed_fields :some_field
+ end
+
+ repository.find_by_some_field("Doesn't exist").should == []
+ end
+ end
+
+ context "find_first_by_index" do
+ it "returns nil if not found" do
+ repository = test_repository do
+ indexed_fields :some_field
+ end
+
+ repository.find_first_by_some_field("Doesn't exist").should be_nil
+ end
+ end
+
describe "delete" do
it "deletes an object" do
repository = test_repository do

0 comments on commit 8f80bab

Please sign in to comment.