posts: mark media asset as expunged when post is expunged.
Fix it so that when a post is expunged, the media asset is also marked as expunged. This way the files will be deleted, but the media asset will still remain as a record of what was expunged. The media asset will have the md5, width, height, file ext, and file size of the deleted file.
This commit is contained in:
@@ -47,6 +47,12 @@ class PostTest < ActiveSupport::TestCase
|
||||
assert_raise(StandardError) { @post.file(:original) }
|
||||
end
|
||||
|
||||
should "mark the media asset as expunged" do
|
||||
@post.expunge!
|
||||
|
||||
assert_equal("expunged", @post.media_asset.status)
|
||||
end
|
||||
|
||||
should "remove all favorites" do
|
||||
@post.expunge!
|
||||
|
||||
|
||||
Reference in New Issue
Block a user