mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: allow category group moderators to pin/unpin topics (#12325)
* FEATURE: allow category group moderators to pin/unpin topics Category group moderators should be able to pin/unpin any topics within a category where they have appropraite category group moderator permissions.
This commit is contained in:
@ -940,12 +940,21 @@ RSpec.describe TopicsController do
|
||||
expect(topic.posts.last.action_code).to eq('archived.disabled')
|
||||
end
|
||||
|
||||
it 'should not allow a group moderator to pin a topic' do
|
||||
it 'should allow a group moderator to pin a topic' do
|
||||
put "/t/#{topic.id}/status.json", params: {
|
||||
status: 'pinned', enabled: 'true'
|
||||
status: 'pinned', enabled: 'true', until: 2.weeks.from_now
|
||||
}
|
||||
|
||||
expect(response.status).to eq(403)
|
||||
expect(response.status).to eq(200)
|
||||
expect(topic.reload.pinned_at).to_not eq(nil)
|
||||
end
|
||||
|
||||
it 'should allow a group moderator to unpin a topic' do
|
||||
put "/t/#{topic.id}/status.json", params: {
|
||||
status: 'pinned', enabled: 'false'
|
||||
}
|
||||
|
||||
expect(response.status).to eq(200)
|
||||
expect(topic.reload.pinned_at).to eq(nil)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user