Guest User

Untitled

a guest
Jul 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. require File.dirname( __FILE__) + '/../test_helper'
  2.  
  3. class ParentTest < ActiveSupport::TestCase
  4. test 'embeds' do
  5. parent = Parent.create(:name => 'Dad')
  6. child = Child.create(:name => 'Child', :cost => 20)
  7. parent.child_groups.build(:resource => child, :quantity => 3)
  8. parent.save
  9. parent.reload
  10. assert_equal 1, parent.children.count
  11. end
  12. end
Add Comment
Please, Sign In to add comment