Improved setup.

This commit is contained in:
Martin Edenhofer 2016-04-26 11:43:27 +02:00
parent b9c24748a9
commit ee4b12f48a

View file

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