Sha256: a20dcd041615c67e6451f88e23f88ddbc442d2ad318900182e4fff1f1ad8b8d4

Contents?: true

Size: 737 Bytes

Versions: 25

Compression:

Stored size: 737 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe Mongoid::Errors::Callback do

  describe "#message" do

    let(:error) do
      described_class.new(Post, :create!)
    end

    it "contains the problem in the message" do
      expect(error.message).to include(
        "Calling create! on Post resulted in a false return from a callback."
      )
    end

    it "contains the summary in the message" do
      expect(error.message).to include(
        "If a before callback returns false when using Document.create!"
      )
    end

    it "contains the resolution in the message" do
      expect(error.message).to include(
        "Double check all before callbacks to make sure they are not"
      )
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
mongoid-8.1.8 spec/mongoid/errors/callback_spec.rb
mongoid-8.1.7 spec/mongoid/errors/callback_spec.rb
mongoid-8.1.6 spec/mongoid/errors/callback_spec.rb
mongoid-8.0.8 spec/mongoid/errors/callback_spec.rb
mongoid-8.1.5 spec/mongoid/errors/callback_spec.rb
mongoid-8.1.4 spec/mongoid/errors/callback_spec.rb
mongoid-8.0.7 spec/mongoid/errors/callback_spec.rb
mongoid-8.1.3 spec/mongoid/errors/callback_spec.rb
mongoid-8.1.2 spec/mongoid/errors/callback_spec.rb
mongoid-8.0.6 spec/mongoid/errors/callback_spec.rb
mongoid-7.5.4 spec/mongoid/errors/callback_spec.rb
mongoid-8.1.1 spec/mongoid/errors/callback_spec.rb
mongoid-8.0.5 spec/mongoid/errors/callback_spec.rb
mongoid-8.1.0 spec/mongoid/errors/callback_spec.rb
mongoid-7.5.3 spec/mongoid/errors/callback_spec.rb
mongoid-8.0.4 spec/mongoid/errors/callback_spec.rb
mongoid-8.0.3 spec/mongoid/errors/callback_spec.rb
mongoid-7.5.2 spec/mongoid/errors/callback_spec.rb
mongoid-8.0.2 spec/mongoid/errors/callback_spec.rb
mongoid-7.5.1 spec/mongoid/errors/callback_spec.rb