Emi Matchu
39bed6b157
In our tests, I discovered an unexpected behavior where calling `item.swf_assets << swf_asset` wasn't updating computed fields correctly. This isn't something we actually do in-app, I think the modeling system happened to trigger the callbacks in a way that still worked fine? But I think this is a good idea for reliability, since caching is such a notoriously difficult thing to get right anyway! And it makes our tests simpler and clearer. Specifically, `compatible_body_ids` references `swf_assets`, which, I'm kinda surprised, *doesn't* include the newly-added asset yet when the `ParentSwfAssetRelationship.after_save` hook runs while calling `item.swf_assets << swf_asset`. Reloading it fixes this! |
||
---|---|---|
.. | ||
fixtures | ||
models | ||
services | ||
support | ||
rails_helper.rb | ||
spec_helper.rb |