Sha256: 3e5f12e775093090326c6f2b860a085859088df342b4a16314e61b727518bd3b

Contents?: true

Size: 772 Bytes

Versions: 27

Compression:

Stored size: 772 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

require "spec_helper"

describe Mongoid::Errors::InverseNotFound do

  describe "#message" do

    let(:error) do
      described_class.new("Town", :citizens, "Person", :town_id)
    end

    it "contains the problem in the message" do
      expect(error.message).to include(
        "When adding a(n) Person to Town#citizens, Mongoid could not"
      )
    end

    it "contains the summary in the message" do
      expect(error.message).to include(
        "hen adding a document to an association, Mongoid attempts to link"
      )
    end

    it "contains the resolution in the message" do
      expect(error.message).to include(
        "If an inverse is not required, like a belongs_to or"
      )
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
mongoid-7.3.5 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.3.4 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.1.11 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.2.6 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.3.3 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.3.2 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.2.5 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.1.10 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.1.9 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.2.4 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.3.1 spec/mongoid/errors/inverse_not_found_spec.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.3.0 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.2.3 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.1.8 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.2.2 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.2.1 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.1.7 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.2.0 spec/mongoid/errors/inverse_not_found_spec.rb
mongoid-7.1.6 spec/mongoid/errors/inverse_not_found_spec.rb