Sha256: 3a9b9fbae831cf15d2774cf3aa7726873a7d0dedfe6923f8fd1370b574230fab

Contents?: true

Size: 704 Bytes

Versions: 3

Compression:

Stored size: 704 Bytes

Contents

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
      error.message.should include(
        "Attempted to set the readonly attribute 'title' with the value: mr."
      )
    end

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

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