Sha256: dd1ffaf348018a1d83cf7720702dad26a65050fde3f980726794ba48b421043f

Contents?: true

Size: 522 Bytes

Versions: 2

Compression:

Stored size: 522 Bytes

Contents

# frozen_string_literal: true
module ApiHelper
  private

  def authenticate!(client = @client || :spy)
    client = shipit_api_clients(client) if client.is_a?(Symbol)
    @client ||= client
    request.headers['Authorization'] = "Basic #{Base64.encode64(client.authentication_token)}"
  end
end

module Shipit
  class ApiControllerTestCase < ActionController::TestCase
    private

    def process(_action, **kwargs)
      if kwargs[:method] != "GET"
        kwargs[:as] ||= :json
      end
      super
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
shipit-engine-0.39.0 test/helpers/api_helper.rb
shipit-engine-0.38.0 test/helpers/api_helper.rb