Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delete test for returning nil when requested variant not yet ready
I tried swapping out the test definition for the ImageData model instead, but the behaviour is different for ImageData - the CarrierWave relative path is returned instead of the URL (as in the `test "returns store path when the model has no assets, although it should (still uploading or error has occurred)" do` test. I'm not entirely clear why the behaviour of ImageData is different to AttachmentData, but given attachments now only ever have the 'original' variant, I doubt this test is needed anymore. I'm also not sure if there's a bit of corresponding logic in the AttachmentData model that can be deleted (or the AssetManagerStorage model, which is, after all, the thing we're supposed to be testing in this file). Couldn't see any code simplification opportunities, so settling for a deleted test. Here's the code I attempted to swap it with: ``` test "returns nil when the model has assets but the requested variant is not yet available" do model = build(:image_data) model.assets = model.assets - [model.assets.last] model.save! model.reload assert_nil model.file.url("s216".to_sym) # what would have been the 'last' asset end ```
- Loading branch information