Sha256: 75786b231a31c1b93d8f44d6584c5eb0e86c20f5431f23fe5fde8140159ecc0a
Contents?: true
Size: 1.76 KB
Versions: 18
Compression:
Stored size: 1.76 KB
Contents
require "spec_helper" describe Mongoid::Errors do describe Mongoid::Errors::DocumentNotFound do describe "#message" do context "default" do before do @error = Mongoid::Errors::DocumentNotFound.new(Person, "3") end it "contains document not found" do @error.message.should include("Document not found") end end end end describe Mongoid::Errors::InvalidOptions do describe "#message" do context "default" do before do @error = Mongoid::Errors::InvalidOptions.new end it "returns the class name" do @error.message.should == @error.class.name end end end end describe Mongoid::Errors::InvalidDatabase do describe "#message" do before do @error = Mongoid::Errors::InvalidDatabase.new("Test") end it "returns a message with the bad db object class" do @error.message.should include("String") end end end describe Mongoid::Errors::Validations do describe "#message" do context "default" do before do @errors = stub(:full_messages => "Testing") @error = Mongoid::Errors::Validations.new(@errors) end it "contains the errors' full messages" do @error.message.should include("Testing") end end end end describe Mongoid::Errors::InvalidCollection do describe "#message" do context "default" do before do @klass = Address @error = Mongoid::Errors::InvalidCollection.new(@klass) end it "contains class is not allowed" do @error.message.should include("Address is not allowed") end end end end end
Version data entries
18 entries across 18 versions & 2 rubygems