```ruby
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

class ActiveSupport::TestCase
  # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
  #
  # Note: You'll currently still have to declare fixtures explicitly in integration tests
  # -- they do not yet inherit this setting
  set_fixture_class :cves => 'Cve'

  fixtures :all

  # Add more helper methods to be used by all tests here...

  def basic_auth_creds(user, password)
    "Basic #{ActiveSupport::Base64.encode64("#{username}:#{password}")}"
  end
end```

Use built-in HTTP_AUTHORIZATION build helper
user
```ruby
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'

class ActiveSupport::TestCase
  # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
  #
  # Note: You'll currently still have to declare fixtures explicitly in integration tests
  # -- they do not yet inherit this setting
  set_fixture_class :cves => Cve

  fixtures :all

  # Add more helper methods to be used by all tests here...

  def basic_auth_creds(user, password)
    ActionController::HttpAuthentication::Basic.encode_credentials(user, password)
  end
end```
assistant