Skip to content
This repository has been archived by the owner on Apr 18, 2018. It is now read-only.

Commit

Permalink
Add test coverage for find_by methods that return no results.
Browse files Browse the repository at this point in the history
  • Loading branch information
braintreeps committed Apr 3, 2012
1 parent e1d12c7 commit 8f80bab
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/curator/repository_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 8f80bab

Please sign in to comment.