Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
  # original has_many :sections, :dependent => :destroy
  # sections belong_to :original
  # The destroy dependent works if I test through a browser

  def test_parent_relationship_with_section

    assert originals(:one).sections                   # tests true
    assert originals(:two).sections.empty?            # tests true
    assert_equal(@section2_original_id, @first_id)    # tests true
    assert originals(:one).destroy                    # tests true
    assert !sections(:one)                            # fails

  end