class HttpBasicAuthenticationTest

Constants

AUTH_HEADERS

Public Instance Methods

test_encode_credentials_has_no_newline() click to toggle source
# File actionpack/test/controller/http_basic_authentication_test.rb, line 108
def test_encode_credentials_has_no_newline
  username = "laskjdfhalksdjfhalkjdsfhalksdjfhklsdjhalksdjfhalksdjfhlakdsjfh"
  password = "kjfhueyt9485osdfasdkljfh4lkjhakldjfhalkdsjf"
  result = ActionController::HttpAuthentication::Basic.encode_credentials(
    username, password)
  assert_no_match(/\n/, result)
end

Private Instance Methods

encode_credentials(username, password) click to toggle source
# File actionpack/test/controller/http_basic_authentication_test.rb, line 176
def encode_credentials(username, password)
  "Basic #{::Base64.encode64("#{username}:#{password}")}"
end