flags/appeals: replace is_resolved flag with statuses.
Replace references to the `is_resolved` field with the `status` field. Post flags were marked as resolved when a post was approved (but not when the post was deleted because it went unapproved). The status field supercedes the resolved field.
This commit is contained in:
@@ -3,6 +3,5 @@ FactoryBot.define do
|
||||
creator
|
||||
post { build(:post, is_flagged: true) }
|
||||
reason {"xxx"}
|
||||
is_resolved {false}
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,10 +8,10 @@ class PostEventsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
as(@user) do
|
||||
@post = create(:post)
|
||||
@post.flag!("aaa")
|
||||
@post = create(:post, is_flagged: true)
|
||||
create(:post_flag, post: @post, status: :rejected)
|
||||
@post.update(is_deleted: true)
|
||||
create(:post_appeal, post: @post)
|
||||
create(:post_appeal, post: @post, status: :succeeded)
|
||||
@post.approve!(@mod)
|
||||
end
|
||||
end
|
||||
@@ -38,9 +38,5 @@ class PostEventsControllerTest < ActionDispatch::IntegrationTest
|
||||
should "render" do
|
||||
assert_not_nil(@appeal)
|
||||
end
|
||||
|
||||
should "return is_resolved correctly" do
|
||||
assert_equal(false, @appeal["is_resolved"])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user