Sha256: 61b99d337ba40087b584f763346053bd06ec10347a21ea9b3d1924b58c88b9be
Contents?: true
Size: 861 Bytes
Versions: 8
Compression:
Stored size: 861 Bytes
Contents
# frozen_string_literal: true require "spec_helper" describe Mongoid::Errors::InvalidField do describe "#message" do module MyModule def crazy_method; self; end end before do Object.send(:include, MyModule) end let(:error) do described_class.new(Person, :crazy_method) end it "contains the problem in the message" do expect(error.message).to include( "Defining a field named 'crazy_method' is not allowed." ) end it "contains the summary in the message" do expect(error.message).to include( "Defining this field would override the method 'crazy_method'" ) end it "contains the resolution in the message" do expect(error.message).to include( "Use Mongoid.destructive_fields to see what names are not allowed" ) end end end
Version data entries
8 entries across 8 versions & 1 rubygems