Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require File.dirname( __FILE__) + '/../test_helper'
- class ParentTest < ActiveSupport::TestCase
- test 'embeds' do
- parent = Parent.create(:name => 'Dad')
- child = Child.create(:name => 'Child', :cost => 20)
- parent.child_groups.build(:resource => child, :quantity => 3)
- parent.save
- parent.reload
- assert_equal 1, parent.children.count
- end
- end
Add Comment
Please, Sign In to add comment