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:
Robin Ward
2019-09-04 09:56:25 -06:00
committed by GitHub
parent e90636eadc
commit bde0ef865f
17 changed files with 287 additions and 2 deletions

View File

@ -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