Sha256: 69d2cf8d4249d465fb341117f30e6353aa741c9cc98acabecc70f39efb5fc94e
Contents?: true
Size: 764 Bytes
Versions: 19
Compression:
Stored size: 764 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, :_type => "Person" }), HashWithIndifferentAccess.new({ :_id => 2, :title => "Madam", :age => 100, :_type => "Person" }) ] 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
19 entries across 19 versions & 1 rubygems