mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
prevent users from ever changing the category of a topic in a support category
This commit is contained in:
parent
578e15224b
commit
e8a6ff4808
2 changed files with 13 additions and 0 deletions
|
@ -898,6 +898,18 @@ describe TopicsController do
|
|||
end
|
||||
end
|
||||
|
||||
context 'when topic is in support category' do
|
||||
let(:another_category) { Fabricate(:category) }
|
||||
|
||||
it "cannot change the category of a topic that is in a support category" do
|
||||
@topic.category = Fabricate(:category, is_support: true)
|
||||
@topic.save!
|
||||
xhr :put, :update, topic_id: @topic.id, slug: @topic.title, category_id: another_category.id
|
||||
expect(response).not_to be_success
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "allow_uncategorized_topics is false" do
|
||||
before do
|
||||
SiteSetting.stubs(:allow_uncategorized_topics).returns(false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue