search: refactor to pass in the current user explicitly.

This commit is contained in:
evazion
2022-09-22 04:16:28 -05:00
parent b56b6c554b
commit 88ac91f5f3
82 changed files with 233 additions and 280 deletions

View File

@@ -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