Sha256: 16c5b05d6e3a6443cb75753035dff82981ee41460dc48c7dd4fdf99d52f6b6cb

Contents?: true

Size: 426 Bytes

Versions: 19

Compression:

Stored size: 426 Bytes

Contents

require 'spec_helper'

describe 'a secure Grape API' do
  subject(:api_call) { get '/api/secure_resource' }

  context 'with an authenticated user', :auth_request do
    it 'should be successful' do
      api_call
      expect(response).to be_http_ok
    end
  end

  context 'without an authenticated user' do
    it 'should be unauthorized' do
      api_call
      expect(response).to be_http_unauthorized
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
g5_authenticatable-0.9.1.pre.2 spec/requests/grape_api_spec.rb
g5_authenticatable-0.8.1.pre spec/requests/grape_api_spec.rb
g5_authenticatable-0.8.0 spec/requests/grape_api_spec.rb
g5_authenticatable-0.8.0.beta1 spec/requests/grape_api_spec.rb
g5_authenticatable-0.7.5 spec/requests/grape_api_spec.rb
g5_authenticatable-0.7.5.beta spec/requests/grape_api_spec.rb
g5_authenticatable-0.7.4 spec/requests/grape_api_spec.rb
g5_authenticatable-0.7.4.beta.1 spec/requests/grape_api_spec.rb
g5_authenticatable-0.7.3 spec/requests/grape_api_spec.rb
g5_authenticatable-0.7.2 spec/requests/grape_api_spec.rb
g5_authenticatable-0.7.1 spec/requests/grape_api_spec.rb
g5_authenticatable-0.7.0 spec/requests/grape_api_spec.rb
g5_authenticatable-0.6.0 spec/requests/grape_api_spec.rb
g5_authenticatable-0.5.1 spec/requests/grape_api_spec.rb
g5_authenticatable-0.5.0 spec/requests/grape_api_spec.rb
g5_authenticatable-0.4.2 spec/requests/grape_api_spec.rb
g5_authenticatable-0.4.1 spec/requests/grape_api_spec.rb
g5_authenticatable-0.4.0 spec/requests/grape_api_spec.rb
g5_authenticatable-0.3.0 spec/requests/grape_api_spec.rb