Permalink
Browse files

Actually test a to_many association with multiple associated objects

  • Loading branch information...
1 parent 889e096 commit b0fbefe00a755067f9b6edc7b5e3112b35d00230 @jeremyevans committed Jun 4, 2012
Showing with 5 additions and 2 deletions.
  1. +4 −1 spec/fd_spec.rb
  2. +1 −1 spec/fixtures/tags.yml
View
@@ -82,10 +82,13 @@ def log
it "should load associated many_to_many records and handle cycles (I->P->NU->P)" do
i = load(:tag__i)
- i.albums.length.should == 1
+ i.albums.length.should == 2
p = i.albums.first
p.id.should == 3
p.name.should == 'P'
+ mo = i.albums.last
+ mo.id.should == 2
+ mo.name.should == 'MO'
nu = p.artist
nu.id.should == 2
nu.name.should == 'NU'
@@ -4,4 +4,4 @@ m:
i:
id: 2
name: I
- albums: p
+ albums: [p, mo]

0 comments on commit b0fbefe

Please sign in to comment.