tablexi/nucore-open — pull request #157 by drench (2014-08-13 19:35:07+00:00)
Title: Destroy statements when their rows are gone [#86773]

The change in 6e8d3d0 should address the issue raised in the ticket (statements existing with no rows), but testing it is another thing.

I marked the first version of the `#remove_order_detail` spec "pending" because I don't know why `destroyed?` returns false in that case. I've verified that the `after_destroy` in `StatementRow` is executing, and the statement seems to be getting destroyed when examining it with `pry`. I ended up adding the `statement.reload` version of the test, but any insight on that appreciated.