Sha256: 3e8b2c2b225b31683322815a2107bacff6d4c183e1e38d1c3e61532dfc7301dc

Contents?: true

Size: 719 Bytes

Versions: 3

Compression:

Stored size: 719 Bytes

Contents

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
      error.message.should include(
        "Could not find metadata for relation 'posts' on model: Person."
      )
    end

    it "contains the summary in the message" do
      error.message.should include(
        "When defining nested attributes for a relation, Mongoid needs"
      )
    end

    it "contains the resolution in the message" do
      error.message.should include(
        "Make sure that there is a relation defined named 'posts' on Person"
      )
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongoid-3.1.7 spec/mongoid/errors/nested_attributes_metadata_not_found_spec.rb
mongoid-3.1.6 spec/mongoid/errors/nested_attributes_metadata_not_found_spec.rb
mongoid-3.1.5 spec/mongoid/errors/nested_attributes_metadata_not_found_spec.rb