Sha256: 6b2c9467678d058034b45486e4883d2dfb09e0c1e7cc3783cb367cd5e52b7d24

Contents?: true

Size: 508 Bytes

Versions: 4

Compression:

Stored size: 508 Bytes

Contents

require "spec_helper"

describe Mongoid::Matchable::In do

  let(:matcher) do
    described_class.new("first")
  end

  describe "#matches?" do

    context "when the values include the attribute" do

      it "returns true" do
        expect(matcher.matches?("$in" => [/\Afir.*\z/, "second"])).to be_true
      end
    end

    context "when the values don't include the attribute" do

      it "returns false" do
        expect(matcher.matches?("$in" => ["third"])).to be_false
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
sepastian-mongoid-rails4-4.0.1.alpha spec/mongoid/matchable/in_spec.rb
sepastian-mongoid-rails4-4.0.0.alpha spec/mongoid/matchable/in_spec.rb
mongoid_heroku_stable-4.0.0 spec/mongoid/matchable/in_spec.rb
mongoid_rails4-4.0.0 spec/mongoid/matchable/in_spec.rb