Sha256: 5a5f009768c2fc50e6c5d1d5eabf400d933089624ccee4a52b1e5763b85f4f4a
Contents?: true
Size: 821 Bytes
Versions: 19
Compression:
Stored size: 821 Bytes
Contents
require 'spec_helper' require 'hyperclient' describe 'token authentication' do include_context 'with a generated app' let(:client_url) { "http://localhost:#{app_port}" } let(:client) { Hyperclient.new(client_url) } it 'returns a forbidden error' do request = Faraday.get client_url response = JSON.parse request.body expect(response['error']).to include 'Forbidden' end context 'with correct token query params' do it 'returns the root presenter' do client.params['token'] = 'replace-me' expect(client._links.self._url).to eq client_url end end context 'with correct Http-Authorization headers' do it 'returns the root presenter' do client.headers['Http-Authorization'] = 'replace-me' expect(client._links.self._url).to eq client_url end end end
Version data entries
19 entries across 19 versions & 1 rubygems