Sha256: bddf82c01443953a9bddea88aef7f438478137c796ada38a631b2c600ec36f52

Contents?: true

Size: 773 Bytes

Versions: 27

Compression:

Stored size: 773 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe Mongoid::Errors::NestedAttributesMetadataNotFound do

  describe "#message" do

    let(:error) do
      described_class.new(Person, :posts)
    end

    it "contains the problem in the message" do
      expect(error.message).to include(
        "Could not find metadata for association 'posts' on model: Person."
      )
    end

    it "contains the summary in the message" do
      expect(error.message).to include(
        "When defining nested attributes for an association, Mongoid needs"
      )
    end

    it "contains the resolution in the message" do
      expect(error.message).to include(
        "Make sure that there is an association defined named 'posts' on Person"
      )
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

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