FEATURE: add staff action log for post approvals

This commit is contained in:
Arpit Jalan
2018-04-23 11:18:53 +05:30
parent c148500d51
commit 0a442977b3
6 changed files with 41 additions and 2 deletions

View File

@ -69,6 +69,11 @@ describe QueuedPost do
expect(post).to be_present
end
it "logs post approvals" do
qp.approve!(admin)
expect(UserHistory.where(action: UserHistory.actions[:post_approved]).count).to eq(1)
end
it "follows the correct workflow for rejection" do
qp.create_pending_action
qp.reject!(admin)
@ -124,6 +129,8 @@ describe QueuedPost do
topic = post.topic
expect(topic).to be_present
expect(topic.category).to eq(category)
expect(UserHistory.where(action: UserHistory.actions[:post_approved]).count).to eq(1)
end
it "rejecting doesn't create the post and topic" do