Sha256: 20af3344dc2b79d162ed2f497de2cb0a300062263ded9303ea5e6acaba102211
Contents?: true
Size: 793 Bytes
Versions: 30
Compression:
Stored size: 793 Bytes
Contents
require File.expand_path(File.join(File.dirname(__FILE__), "/../../../../spec_helper.rb")) 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
30 entries across 30 versions & 1 rubygems