users: move sockpuppet detection from model to controller.
This commit is contained in:
@@ -231,21 +231,6 @@ class UserTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
context "that might be a sock puppet" do
|
||||
setup do
|
||||
@user = FactoryBot.create(:user, last_ip_addr: "127.0.0.2")
|
||||
Danbooru.config.unstub(:enable_sock_puppet_validation?)
|
||||
end
|
||||
|
||||
should "not validate" do
|
||||
CurrentUser.scoped(nil, "127.0.0.2") do
|
||||
@user = FactoryBot.build(:user)
|
||||
@user.save
|
||||
assert_equal(["Last ip addr was used recently for another account and cannot be reused for another day"], @user.errors.full_messages)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "when searched by name" do
|
||||
should "match wildcards" do
|
||||
user1 = FactoryBot.create(:user, :name => "foo")
|
||||
|
||||
Reference in New Issue
Block a user