Sha256: d0fbee93f3e8daee12080d6460c7f8efb663a6d4eeebdac0995b104761823ed4

Contents?: true

Size: 572 Bytes

Versions: 9

Compression:

Stored size: 572 Bytes

Contents

module JsonApiController
  shared_examples 'an app IDM endpoint' do
    subject { get :index }

    context 'without authentication' do
      it { is_expected.to have_http_status(:unauthorized), "response.code: #{response.code}" }
    end

    context 'with authentication' do
      let(:config) { Maestrano.configs.values.first }
      before { @request.env['HTTP_AUTHORIZATION'] = 'Basic ' + Base64.encode64("#{config.param('api.id')}:#{config.param('api.key')}") }

      it { is_expected.to have_http_status(:ok), "response.code: #{response.code}" }
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.3.6 lib/testing_support/shared_examples/json_api_controller.rb
maestrano-connector-rails-2.3.5 lib/testing_support/shared_examples/json_api_controller.rb
maestrano-connector-rails-2.3.4 lib/testing_support/shared_examples/json_api_controller.rb
maestrano-connector-rails-2.3.3 lib/testing_support/shared_examples/json_api_controller.rb
maestrano-connector-rails-2.3.2 lib/testing_support/shared_examples/json_api_controller.rb
maestrano-connector-rails-2.3.1 lib/testing_support/shared_examples/json_api_controller.rb
maestrano-connector-rails-2.3.0 lib/testing_support/shared_examples/json_api_controller.rb
maestrano-connector-rails-2.2.1 lib/testing_support/shared_examples/json_api_controller.rb
maestrano-connector-rails-2.2.0 lib/testing_support/shared_examples/json_api_controller.rb