mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
DEV: Add test to ensure /categories/search doesn't return secret categories (#27469)
This commit is contained in:
parent
93c2ae585c
commit
a1d881f625
@ -1433,5 +1433,14 @@ RSpec.describe CategoriesController do
|
||||
expect(category["has_children"]).to eq(true)
|
||||
expect(category["subcategory_count"]).to eq(1)
|
||||
end
|
||||
|
||||
it "doesn't expose secret categories" do
|
||||
category.update!(read_restricted: true)
|
||||
|
||||
post "/categories/search.json", params: { term: "" }
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
expect(response.parsed_body["categories"].map { |c| c["id"] }).not_to include(category.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user