mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 08:20:33 +08:00
FEATURE: Adds a pop up that shows a more detailed score for reviewables (#8035)
If you click a (?) icon beside the reviewable status a pop up will appear with expanded informatio that explains how the reviewable got its score, and how it compares to system thresholds.
This commit is contained in:
@ -236,6 +236,30 @@ describe ReviewablesController do
|
||||
end
|
||||
end
|
||||
|
||||
context "#explain" do
|
||||
context "basics" do
|
||||
fab!(:reviewable) { Fabricate(:reviewable) }
|
||||
|
||||
before do
|
||||
sign_in(Fabricate(:moderator))
|
||||
end
|
||||
|
||||
it "returns the explanation as json" do
|
||||
get "/review/#{reviewable.id}/explain.json"
|
||||
expect(response.code).to eq("200")
|
||||
|
||||
json = ::JSON.parse(response.body)
|
||||
expect(json['reviewable_explanation']['id']).to eq(reviewable.id)
|
||||
expect(json['reviewable_explanation']['total_score']).to eq(reviewable.score)
|
||||
end
|
||||
|
||||
it "returns 404 for a missing reviewable" do
|
||||
get "/review/123456789/explain.json"
|
||||
expect(response.code).to eq("404")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "#perform" do
|
||||
fab!(:reviewable) { Fabricate(:reviewable) }
|
||||
before do
|
||||
|
Reference in New Issue
Block a user