Created
August 23, 2010 21:05
-
-
Save lancecarlson/546332 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before :each do | |
@user = User.new(:email => '[email protected]') | |
@profile = Profile.new(:name => 'Ripple') | |
@billing = Address.new(:street => '123 Somewhere Dr', :kind => 'billing') | |
@shipping = Address.new(:street => '321 Anywhere Pl', :kind => 'shipping') | |
@friend1 = User.create(:email => "[email protected]") | |
@friend2 = User.create(:email => "[email protected]") | |
end | |
it "should save a many linked association" do | |
@user.friends << @friend1 << @friend2 | |
@user.save | |
@user.should_not be_new_record | |
@found = User.find(@user.key) | |
@found.friends.map(&:key).should include(@friend1.key) | |
@found.friends.map(&:key).should include(@friend2.key) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment