spec/mongoid/persistable/creatable_spec.rb in mongoid-5.4.1 vs spec/mongoid/persistable/creatable_spec.rb in mongoid-6.0.0.beta
- old
+ new
@@ -527,11 +527,11 @@
end
it "raises an error" do
expect {
4.times { Person.create!(ssn: "555-55-1029") }
- }.to raise_error
+ }.to raise_error(Mongo::Error::OperationFailure)
end
end
end
context "when passing in a block" do
@@ -560,10 +560,10 @@
it "saves the document" do
expect(account).to be_persisted
end
end
- context "when a callback returns false" do
+ context "when a callback aborts the chain" do
it "raises a callback error" do
expect { Oscar.create! }.to raise_error(Mongoid::Errors::Callback)
end
end