CurrentUser: remove #as method.
Replace with CurrentUser#scoped.
This commit is contained in:
@@ -81,7 +81,7 @@ module Moderator
|
||||
setup do
|
||||
@users = (0..5).map {create(:user)}
|
||||
|
||||
CurrentUser.as(@users[0]) do
|
||||
as(@users[0]) do
|
||||
@comment = create(:comment)
|
||||
end
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ class ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
def as(user, &block)
|
||||
CurrentUser.as(user, &block)
|
||||
CurrentUser.scoped(user, &block)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class DanbooruMaintenanceTest < ActiveSupport::TestCase
|
||||
banner = FactoryBot.create(:admin_user)
|
||||
user = FactoryBot.create(:user)
|
||||
|
||||
CurrentUser.as(banner) { FactoryBot.create(:ban, user: user, banner: banner, duration: 1) }
|
||||
as(banner) { create(:ban, user: user, banner: banner, duration: 1) }
|
||||
|
||||
assert_equal(true, user.reload.is_banned)
|
||||
travel_to(2.days.from_now) { DanbooruMaintenance.daily }
|
||||
|
||||
Reference in New Issue
Block a user