tests: fix ip ban test regression.
This commit is contained in:
@@ -40,10 +40,12 @@ class UserTest < ActiveSupport::TestCase
|
|||||||
end
|
end
|
||||||
|
|
||||||
should "not validate if the originating ip address is banned" do
|
should "not validate if the originating ip address is banned" do
|
||||||
FactoryBot.create(:ip_ban, ip_addr: '127.0.0.1')
|
CurrentUser.scoped(User.anonymous, "1.2.3.4") do
|
||||||
user = FactoryBot.build(:user)
|
create(:ip_ban, ip_addr: '1.2.3.4')
|
||||||
user.save
|
user = build(:user, last_ip_addr: '1.2.3.4')
|
||||||
assert_equal("IP address is banned", user.errors.full_messages.join)
|
refute(user.valid?)
|
||||||
|
assert_equal("IP address is banned", user.errors.full_messages.join)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
should "limit post uploads" do
|
should "limit post uploads" do
|
||||||
|
|||||||
Reference in New Issue
Block a user