Sha256: 3e82aefa4203a2f5f40cab1f4d8a5b527bb2b06ba0e50949efbae59e674b9241
Contents?: true
Size: 724 Bytes
Versions: 17
Compression:
Stored size: 724 Bytes
Contents
require "spec_helper" describe Mongoid::Extensions::Array::Conversions do describe "#mongoidize" do it "collects each of its attributes" do array = [ Person.new(:_id => 1, :title => "Sir"), Person.new(:_id => 2, :title => "Madam") ] array.mongoidize.should == [ HashWithIndifferentAccess.new({ :_id => 1, :title => "Sir", :age => 100 }), HashWithIndifferentAccess.new({ :_id => 2, :title => "Madam", :age => 100 }) ] end end describe "#get" do it "returns the array" do Array.get(["test"]).should == ["test"] end end describe "#set" do it "returns the array" do Array.set(["test"]).should == ["test"] end end end
Version data entries
17 entries across 17 versions & 1 rubygems