1 require File.join( File.dirname(__FILE__), "..", "..", "spec_helper" )
5 DataMapper.auto_migrate!
8 describe "associations" do
9 it "should have n orders" do
10 orders = (1..10).of {Order.gen}
11 customer = Customer.create(Customer.gen_attrs.merge(:orders => orders))
12 customer.orders = orders
13 customer.should be_valid
16 it "should have n addresses" do
17 pending ":through working in DM"
18 addresses = (1..10).of {Address.gen}
19 customer = Customer.create(Customer.gen_attrs.merge(:addresses => addresses))
20 customer.addresses = addresses
21 customer.should be_valid
24 it "should have n accounts" do
25 pending ":through working in DM"
26 accounts = (1..10).of {Account.gen}
27 customer = Customer.create(Customer.gen_attrs.merge(:accounts => accounts))
28 customer.accounts = accounts
29 customer.should be_valid