Closed tovodeverett closed 11 years ago
oops. you're right, it should just happen once, inside the expect
. must have been left behind during editing.
i probably didn't notice since the spec does do what it should anyway: if the bug is there the error will be raised and the spec will fail, and if the bug isn't there the spec will pass.
but still, yeah, if you're going in there and cleaning things up you may as well fix it.
thanks
I'm confused a little by the spec in https://github.com/lomba/schema_associations/blob/master/spec/association_spec.rb#L555. That spec reads:
I can't figure out why
Post.joins(:comments).all
is run both outside theexpect
block and inside it. If it's really supposed to happen twice, shouldn't both of them be expected to not raise errors. And if it only needs to run once, wouldn't the second line be sufficient? I've tracked this code back to https://github.com/lomba/schema_associations/commit/36c4100ba3995cb799e430e17c72bc1e9131d8cc, but it's just a fresh block of code there.Thoughts?
I noticed it because I'm modifying that test in my Rails 4 clean up, and if we only really need to call it once in the
expect
block then I can fix that in my clean up.