FEATURE: Add recover api scopes (#25978)

This commit adds two new api scopes. One for recovering topics, and the
other for recovering posts.
This commit is contained in:
Blake Erickson
2024-02-29 15:49:29 -07:00
committed by GitHub
parent 0b778697ff
commit 2d890d73a2
3 changed files with 12 additions and 0 deletions

View File

@ -478,6 +478,7 @@ RSpec.describe Admin::ApiController do
"/t/:slug/:topic_id/last (GET)",
"/t/:topic_id/posts (GET)",
"/latest.rss (GET)",
"/t/:topic_id/recover (PUT)",
]
topic_routes.each do |route|
@ -486,6 +487,9 @@ RSpec.describe Admin::ApiController do
expect(scopes["posts"].any? { |h| h["urls"].include?("/posts (GET)") }).to be_truthy
expect(scopes["posts"].any? { |h| h["urls"].include?("/private-posts (GET)") }).to be_truthy
expect(
scopes["posts"].any? { |h| h["urls"].include?("/posts/:post_id/recover (PUT)") },
).to be_truthy
expect(scopes["users"].find { _1["key"] == "update" }["urls"]).to contain_exactly(
"/users/:username (PUT)",