posts: rework post events page.
* Add a global /post_events page that shows the history of all approvals, disapprovals, flags, appeals, and replacements on a single page. * Redesign the /posts/:id/events page to show all approval, disapproval, flag, appeal, and replacement events for a single post (before it only showed approvals, flags, and appeals). * Remove the replacement history link from the post show page. Replacements are now included in the post events page (closes #4948: Highlighed replacements). * Add /post_approvals/:id and /post_replacements/:id routes (these are used by the "Details" link on the post events page).
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
require 'test_helper'
|
||||
|
||||
class PostEventTest < ActiveSupport::TestCase
|
||||
def setup
|
||||
@user = create(:user, created_at: 2.weeks.ago)
|
||||
@post = create(:post)
|
||||
@post_flag = create(:post_flag, creator: @user, post: @post)
|
||||
@post.update(is_deleted: true)
|
||||
@post_appeal = create(:post_appeal, creator: @user, post: @post)
|
||||
end
|
||||
|
||||
context "PostEvent.find_for_post" do
|
||||
should "work" do
|
||||
results = PostEvent.find_for_post(@post.id)
|
||||
assert_equal(2, results.size)
|
||||
assert_equal("appeal", results[0].type_name)
|
||||
assert_equal("flag", results[1].type_name)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user