Sha256: 68f621499bf15abbb221e796183a7b23f1a7ae2bd2ab2db3d4afa7795873167a

Contents?: true

Size: 490 Bytes

Versions: 4

Compression:

Stored size: 490 Bytes

Contents

require "spec_helper"

describe Mongoid::Matchable::Size do

  let(:matcher) do
    described_class.new(["first", "second"])
  end

  describe "#matches?" do

    context "when the attribute is the same size" do

      it "returns true" do
        expect(matcher.matches?("$size" => 2)).to be_true
      end
    end

    context "when the attribute is not the same size" do

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