Sha256: 5f42c8512774938328ac3364eae626cde9658b7166bd8bfa4ab156043f2c8b20
Contents?: true
Size: 587 Bytes
Versions: 28
Compression:
Stored size: 587 Bytes
Contents
require "spec_helper" describe Mongoid::Finders do describe "#find" do before do @document = Person.create(:title => "Mrs.") end after do Person.delete_all end context "with an id as an argument" do context "when the document is found" do it "returns the document" do Person.find(@document.id).should == @document end end context "when the document is not found" do it "raises an error" do lambda { Person.find("5") }.should raise_error end end end end end
Version data entries
28 entries across 28 versions & 1 rubygems