Sha256: afa55171b26c206e4ae641407365e002c4b1d855728f03ae5fe6ae89e7618a86

Contents?: true

Size: 774 Bytes

Versions: 24

Compression:

Stored size: 774 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"

describe Mongoid::Errors::UnsupportedJavascript do

  describe "#message" do

    let(:error) do
      described_class.new(Address, "this.street == null")
    end

    it "contains the problem in the message" do
      expect(error.message).to include(
        "Executing Javascript $where selector on an embedded criteria is not supported"
      )
    end

    it "contains the summary in the message" do
      expect(error.message).to include(
        "Mongoid only supports providing a hash of arguments to #where"
      )
    end

    it "contains the resolution in the message" do
      expect(error.message).to include(
        "Please provide a standard hash to #where when the criteria"
      )
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
mongoid-8.1.7 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.1.6 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.0.8 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.1.5 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.1.4 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.0.7 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.1.3 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.1.2 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.0.6 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-7.5.4 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.1.1 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.0.5 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.1.0 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-7.5.3 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.0.4 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.0.3 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-7.5.2 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-8.0.2 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-7.5.1 spec/mongoid/errors/unsupported_javascript_spec.rb
mongoid-7.4.3 spec/mongoid/errors/unsupported_javascript_spec.rb