Sha256: 898941a2315065a2ddf9250ad7b3fccc99da7c34abdc91deb93e592ea8346a5b

Contents?: true

Size: 710 Bytes

Versions: 3

Compression:

Stored size: 710 Bytes

Contents

require "spec_helper"

describe Mongoid::Errors::InvalidOptions do

  describe "#message" do

    let(:error) do
      described_class.new(:name, :invalid, [ :valid ])
    end

    it "contains the problem in the message" do
      error.message.should include(
        "Invalid option :invalid provided to relation :name."
      )
    end

    it "contains the summary in the message" do
      error.message.should include(
        "Mongoid checks the options that are passed to the relation macros"
      )
    end

    it "contains the resolution in the message" do
      error.message.should include(
        "Valid options are: valid, make sure these are the ones you are using."
      )
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

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