Sha256: cacadf972f9e3d6ec986ee3e4cf14fc220691acc13aadac16495279edcab7457
Contents?: true
Size: 724 Bytes
Versions: 10
Compression:
Stored size: 724 Bytes
Contents
require "spec_helper" describe Mongoid::Contexts do context ".context_for" do let(:klass) { stub('klass', :embedded => false) } let(:criteria) { stub('criteria', :klass => klass) } context "when criteria is for a top-level Mongoid::Document" do it "creates a Mongo context" do Mongoid::Contexts::Mongo.expects(:new).with(criteria) Mongoid::Contexts.context_for(criteria) end end context "when criteria is for an embedded Mongoid::Document" do it "creates a Mongo context" do klass.stubs(:embedded).returns(true) Mongoid::Contexts::Enumerable.expects(:new).with(criteria) Mongoid::Contexts.context_for(criteria) end end end end
Version data entries
10 entries across 10 versions & 2 rubygems