Sha256: 5f3e1f40d111039aacf15344814bd517617b5cf442ee29c521e3b921181de9f8

Contents?: true

Size: 734 Bytes

Versions: 8

Compression:

Stored size: 734 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe Mongoid::Errors::NoEnvironment do

  describe "#message" do

    let(:error) do
      described_class.new
    end

    it "contains the problem in the message" do
      expect(error.message).to include(
        "Could not load the configuration since no environment was defined."
      )
    end

    it "contains the summary in the message" do
      expect(error.message).to include(
        "Mongoid attempted to find the appropriate environment but no Rails.env"
      )
    end

    it "contains the resolution in the message" do
      expect(error.message).to include(
        "Make sure some environment is set from the mentioned options"
      )
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mongoid-7.5.4 spec/mongoid/errors/no_environment_spec.rb
mongoid-7.5.3 spec/mongoid/errors/no_environment_spec.rb
mongoid-7.5.2 spec/mongoid/errors/no_environment_spec.rb
mongoid-7.5.1 spec/mongoid/errors/no_environment_spec.rb
mongoid-7.4.3 spec/mongoid/errors/no_environment_spec.rb
mongoid-7.5.0 spec/mongoid/errors/no_environment_spec.rb
mongoid-7.4.1 spec/mongoid/errors/no_environment_spec.rb
mongoid-7.4.0 spec/mongoid/errors/no_environment_spec.rb