Sha256: 838076021ca9b24cc2729f42db985b5cd013ec523f8177e70ec505d4c4191537
Contents?: true
Size: 667 Bytes
Versions: 11
Compression:
Stored size: 667 Bytes
Contents
require "spec_helper" describe Mongoid::Extensions::Proc::Scoping do describe "#scoped" do context "when the proc accessed a hash" do before do @proc = lambda { |number| { :where => { :count => number } } } end it "calls the hash with the args" do @proc.scoped(10).should == { :where => { :count => 10 } } end end context "when the proc calls a criteria" do before do @proc = lambda { |title| Person.where(:title => title) } end it "returns the criteria scoped" do @proc.scoped("Sir").should == { :where => { :title => "Sir" } } end end end end
Version data entries
11 entries across 11 versions & 3 rubygems