posts: fix double deletion bug.
Fix a bug where, if a user a was deleting a post and they accidentally clicked the delete button twice, it could create two flags.
This commit is contained in:
@@ -4,7 +4,7 @@ class PrunePostsJobTest < ActiveJob::TestCase
|
||||
context "PrunePostsJob" do
|
||||
should "prune expired posts" do
|
||||
@pending = create(:post, is_pending: true, created_at: 5.days.ago)
|
||||
@flagged = create(:post, is_flagged: true, created_at: 5.days.ago)
|
||||
@flagged = create(:post, created_at: 5.days.ago)
|
||||
@appealed = create(:post, is_deleted: true, created_at: 5.days.ago)
|
||||
|
||||
@flag = create(:post_flag, post: @flagged, created_at: 4.days.ago)
|
||||
|
||||
Reference in New Issue
Block a user