ENV['RAILS_ENV'] ||= 'test'
require_relative '../config/environment'
require 'rails/test_help'
class ActiveSupport::TestCase
  include Devise::Test::IntegrationHelpers
  include Warden::Test::Helpers

  include FactoryBot::Syntax::Methods

  def login(user:)
    if integration_test?
      login_as(user, scope: :user)
    else
      sign_in(user)
    end
  end
end
