Module: ApiRspecta::ApiRequestsHelpers::RequestHelpers

Defined in:
lib/api_rspecta.rb

Instance Method Summary collapse

Instance Method Details

#auth_header(options) ⇒ Object



94
95
96
# File 'lib/api_rspecta.rb', line 94

def auth_header options
  options[:auth_header] || {}
end

#default_optionsObject



98
99
100
# File 'lib/api_rspecta.rb', line 98

def default_options
  { auth_header: token_auth_header }
end

#guest_optionsObject



102
103
104
# File 'lib/api_rspecta.rb', line 102

def guest_options
  {}
end

#token_auth_headerObject



89
90
91
92
# File 'lib/api_rspecta.rb', line 89

def token_auth_header
  #{ 'HTTP_AUTHORIZATION' => ActionController::HttpAuthentication::Token.encode_credentials(ENV['auth_token']) }
  {}
end