users: don't allow users to choose reserved names.
Don't allow users to choose names that conflict with search syntax, like `any` or `none`, or names that impersonate user levels, like `Admin`, `Moderator`, `Anonymous`, etc.
This commit is contained in:
@@ -32,7 +32,7 @@ class BansControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
context "index action" do
|
||||
setup do
|
||||
@mod = create(:mod_user, name: "mod")
|
||||
@mod = create(:mod_user, name: "mod123")
|
||||
@ban1 = create(:ban, created_at: 1.week.ago, duration: 1.day)
|
||||
@ban2 = create(:ban, user: build(:builder_user), reason: "blah", banner: @mod, duration: 100.years)
|
||||
end
|
||||
@@ -47,7 +47,7 @@ class BansControllerTest < ActionDispatch::IntegrationTest
|
||||
should respond_to_search(expired: "false").with { @ban2 }
|
||||
should respond_to_search(duration: "<1w").with { @ban1 }
|
||||
|
||||
should respond_to_search(banner_name: "mod").with { @ban2 }
|
||||
should respond_to_search(banner_name: "mod123").with { @ban2 }
|
||||
should respond_to_search(banner: { level: User::Levels::MODERATOR }).with { @ban2 }
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user