Sha256: 18ef5dba5f6f5f3c0267300b0bd59a233723f2251e7fa9c56062e7a83202df11

Contents?: true

Size: 731 Bytes

Versions: 3

Compression:

Stored size: 731 Bytes

Contents

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
      error.message.should include(
        "Executing Javascript $where selector on an embedded criteria is not supported"
      )
    end

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

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