Improved setup.
This commit is contained in:
parent
b9c24748a9
commit
ee4b12f48a
1 changed files with 22 additions and 14 deletions
|
@ -4,6 +4,15 @@ require 'test_helper'
|
||||||
class SearchControllerTest < ActionDispatch::IntegrationTest
|
class SearchControllerTest < ActionDispatch::IntegrationTest
|
||||||
setup do
|
setup do
|
||||||
|
|
||||||
|
# clear cache
|
||||||
|
Cache.clear
|
||||||
|
|
||||||
|
# remove background jobs
|
||||||
|
Delayed::Job.destroy_all
|
||||||
|
|
||||||
|
# set current user
|
||||||
|
UserInfo.current_user_id = 1
|
||||||
|
|
||||||
# set accept header
|
# set accept header
|
||||||
@headers = { 'ACCEPT' => 'application/json', 'CONTENT_TYPE' => 'application/json' }
|
@headers = { 'ACCEPT' => 'application/json', 'CONTENT_TYPE' => 'application/json' }
|
||||||
|
|
||||||
|
@ -11,7 +20,6 @@ class SearchControllerTest < ActionDispatch::IntegrationTest
|
||||||
roles = Role.where(name: %w(Admin Agent))
|
roles = Role.where(name: %w(Admin Agent))
|
||||||
groups = Group.all
|
groups = Group.all
|
||||||
|
|
||||||
UserInfo.current_user_id = 1
|
|
||||||
@admin = User.create_or_update(
|
@admin = User.create_or_update(
|
||||||
login: 'search-admin',
|
login: 'search-admin',
|
||||||
firstname: 'Search',
|
firstname: 'Search',
|
||||||
|
|
Loading…
Reference in a new issue