Sha256: b39c05ef1db846394234d04200662e94b0bd890056e3c1eaf162c095ec5d2930

Contents?: true

Size: 608 Bytes

Versions: 2

Compression:

Stored size: 608 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe 'a secure Grape API endpoint' do
  let(:endpoint) { '/grape_api/hello' }
  let(:params) {}
  let(:headers) {}

  describe 'GET request' do
    subject(:api_call) { safe_get endpoint, params, headers }

    it_should_behave_like 'a warden authenticatable api'
    it_should_behave_like 'a token authenticatable api'
  end

  describe 'POST request' do
    subject(:api_call) { safe_post endpoint, params, headers }

    it_should_behave_like 'a warden authenticatable api'
    it_should_behave_like 'a token authenticatable api'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
g5_authenticatable_api-1.0.0 spec/requests/grape_api_spec.rb
g5_authenticatable_api-1.0.0.pre.1 spec/requests/grape_api_spec.rb