Sha256: 56bd224bc6e3095dacf2a613bb702e4422993712c3d26a4f05f4c03d672e2eaf

Contents?: true

Size: 912 Bytes

Versions: 27

Compression:

Stored size: 912 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe Mongoid::Errors::InvalidIncludes do

  describe "#message" do

    context "default" do

      let(:klass) do
        Band
      end

      let(:args) do
        [ :members ]
      end

      let(:error) do
        described_class.new(klass, args)
      end

      it "contains the problem in the message" do
        expect(error.message).to include(
          "Invalid includes directive: Band.includes(:members)"
        )
      end

      it "contains the summary in the message" do
        expect(error.message).to include(
          "Eager loading in Mongoid only supports providing arguments to Band.includes"
        )
      end

      it "contains the resolution in the message" do
        expect(error.message).to include(
          "Ensure that each parameter passed to Band.includes is a valid name"
        )
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
mongoid-8.1.9 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.0.9 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.1.8 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.1.7 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.1.6 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.0.8 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.1.5 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.1.4 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.0.7 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.1.3 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.1.2 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.0.6 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-7.5.4 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.1.1 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.0.5 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.1.0 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-7.5.3 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.0.4 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-8.0.3 spec/mongoid/errors/invalid_includes_spec.rb
mongoid-7.5.2 spec/mongoid/errors/invalid_includes_spec.rb