Sha256: 6d81aa56a6b52a8027a2d8855d5de212a9aa30a9f41a7e089e3e5a2706151834

Contents?: true

Size: 508 Bytes

Versions: 4

Compression:

Stored size: 508 Bytes

Contents

require "spec_helper"

describe Mongoid::Matchable::Nin do

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

  describe "#matches?" do

    context "when the values do not contain the attribute" do

      it "returns true" do
        expect(matcher.matches?("$nin" => ["second", "third"])).to be_true
      end
    end

    context "when the values contain the attribute" do

      it "returns false" do
        expect(matcher.matches?("$nin" => ["first"])).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/nin_spec.rb
sepastian-mongoid-rails4-4.0.0.alpha spec/mongoid/matchable/nin_spec.rb
mongoid_heroku_stable-4.0.0 spec/mongoid/matchable/nin_spec.rb
mongoid_rails4-4.0.0 spec/mongoid/matchable/nin_spec.rb