Sha256: 9f887189bb2dd8206f583e8928b63eced9068ec00c540eaa59879cf6272ae443

Contents?: true

Size: 367 Bytes

Versions: 49

Compression:

Stored size: 367 Bytes

Contents

require "spec_helper"

describe Mongoid::Extensions::Hash::CriteriaHelpers do

  describe "#expand_complex_criteria" do

    before do
      @hash = {:age.gt => 40, :title => "Title"}
    end

    it "expands complex criteria to form a valid `where` hash" do
      @hash.expand_complex_criteria.should == {:age => {"$gt" => 40}, :title => "Title"}
    end

  end

end

Version data entries

49 entries across 49 versions & 3 rubygems

Version Path
mongoid-locomotive-2.0.0.beta9 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-pre-2.0.0.beta1 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-2.0.0.alpha spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.14 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.13 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.12 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.11 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.10 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.9 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.8 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.7 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-pre-2.0.0.pre spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.6 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.5 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.4 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.3 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.2 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.1 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.2.0 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb
mongoid-1.1.4 spec/unit/mongoid/extensions/hash/criteria_helpers_spec.rb