Sha256: 2ffad99315d5f7c8497c384896939b7c4b4e75bf2a01b672e50627120f134a92
Contents?: true
Size: 678 Bytes
Versions: 59
Compression:
Stored size: 678 Bytes
Contents
require "spec_helper" describe Mongoid::Extensions::Array::Assimilation do describe "#assimilate" do before do @address_one = { :street => "Circular Quay" } @address_two = Address.new(:street => "King St.") @parent = Person.new(:title => "Mr.") @options = Mongoid::Associations::Options.new(:name => :addresses) @child = [@address_one, @address_two] end it "incorporates the hash into the object graph" do @child.assimilate(@parent, @options) @parent.addresses.size.should == 2 @parent.addresses.first.street.should == "Circular Quay" @parent.addresses.last.street.should == "King St." end end end
Version data entries
59 entries across 59 versions & 3 rubygems