Sha256: 5ca69b272727c5506ffcecc43e65c1c9a153842880fe3ac83fb8a17e316dee02

Contents?: true

Size: 747 Bytes

Versions: 24

Compression:

Stored size: 747 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe Mongoid::Errors::ReadonlyAttribute do

  describe "#message" do

    let(:error) do
      described_class.new(:title, "mr")
    end

    it "contains the problem in the message" do
      expect(error.message).to include(
        "Attempted to set the readonly attribute 'title' with the value: mr."
      )
    end

    it "contains the summary in the message" do
      expect(error.message).to include(
        "Attributes flagged as readonly via Model.attr_readonly can only"
      )
    end

    it "contains the resolution in the message" do
      expect(error.message).to include(
        "Don't define 'title' as readonly, or do not attempt to update"
      )
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

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