search: refactor to pass in the current user explicitly.
This commit is contained in:
@@ -64,6 +64,12 @@ class ActiveSupport::TestCase
|
||||
def as(user, &block)
|
||||
CurrentUser.scoped(user, &block)
|
||||
end
|
||||
|
||||
def assert_search_equals(expected_results, current_user: CurrentUser.user, **params)
|
||||
results = subject.class.search(params, current_user)
|
||||
|
||||
assert_equal(Array(expected_results).map(&:id), results.ids)
|
||||
end
|
||||
end
|
||||
|
||||
class ActionDispatch::IntegrationTest
|
||||
|
||||
Reference in New Issue
Block a user