Sha256: 7d7195a5c8c0a20c47880af7574ac059c076cdecfdbe964589ff68836e0d4c20

Contents?: true

Size: 567 Bytes

Versions: 1

Compression:

Stored size: 567 Bytes

Contents

module WebmockStubsHelper
  RSpec.configure do |config|
    config.include self
  end

  def stub_client_credentials_request
    stub_request(:post, "https://client_id:client_secret@accounts2.applicaster.com/oauth/token").
       with(:body => {"grant_type"=>"client_credentials"}).
       to_return(successful_json_response(access_token: "client-credentials-token"))
  end

    def successful_json_response(body)
      {
        status: 200,
        body: body.to_json,
        headers: {
          "Content-Type" => "application/json"
        }
      }
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-applicaster-1.1.0 spec/support/webmock_stubs_helper.rb