2021-03-31 13:38:49 +00:00
|
|
|
ENV['RAILS_ENV'] ||= 'test'
|
2021-04-29 06:41:23 +00:00
|
|
|
require_relative '../config/environment'
|
|
|
|
|
require 'rails/test_help'
|
2021-03-31 13:38:49 +00:00
|
|
|
|
|
|
|
|
class ActiveSupport::TestCase
|
|
|
|
|
# Run tests in parallel with specified workers
|
|
|
|
|
parallelize(workers: :number_of_processors)
|
|
|
|
|
|
|
|
|
|
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
|
|
|
|
|
fixtures :all
|
|
|
|
|
|
2021-04-25 12:35:36 +00:00
|
|
|
def auth_header(user)
|
|
|
|
|
token = JsonWebToken.encode(user_id: user.id)
|
2021-04-29 06:41:23 +00:00
|
|
|
{ 'Authorization' => token }
|
2021-04-25 12:35:36 +00:00
|
|
|
end
|
2021-03-31 13:38:49 +00:00
|
|
|
end
|