mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 16:29:32 +08:00
FEATURE: the ability to change the order of flags (#27269)
Continued work on moderate flags UI. In this PR admins are allowed to change the order of flags. The notify user flag is always on top but all other flags can be moved.
This commit is contained in:

committed by
GitHub

parent
c1ecbb8d28
commit
aa88b07640
@ -41,4 +41,14 @@ RSpec.describe FlagGuardian do
|
||||
expect(Guardian.new(user).can_toggle_flag?).to eq(false)
|
||||
end
|
||||
end
|
||||
|
||||
describe "#can_reorder_flag?" do
|
||||
it "returns true for admin and false for regular user and notify_user" do
|
||||
expect(Guardian.new(admin).can_reorder_flag?(Flag.system.last)).to eq(true)
|
||||
expect(
|
||||
Guardian.new(admin).can_reorder_flag?(Flag.system.find_by(name_key: "notify_user")),
|
||||
).to eq(false)
|
||||
expect(Guardian.new(user).can_reorder_flag?(Flag.system.last)).to eq(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user