Sha256: 5b62c6285ff8dd91aeb773a36be93276fad5ea0f7d182aa3cacede37a0ca3cb0

Contents?: true

Size: 727 Bytes

Versions: 2

Compression:

Stored size: 727 Bytes

Contents

require 'securerandom'
require 'json'

shared_context 'with an initialized client' do
  subject(:client) { Mrkt::Client.new(host: host, client_id: client_id, client_secret: client_secret) }

  let(:host) { '0-KBZ-0.mktorest.com' }
  let(:client_id) { SecureRandom.uuid }
  let(:client_secret) { SecureRandom.hex }
  let(:authentication_stub) do
    { access_token: SecureRandom.uuid, token_type: 'bearer', expires_in: 2241, scope: 'RestClient' }
  end

  before do
    @authentication_request_stub = stub_request(:get, "https://#{host}/identity/oauth/token")
      .with(query: { client_id: client_id, client_secret: client_secret, grant_type: 'client_credentials' })
      .to_return(json_stub(authentication_stub))
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mrkt-1.2.2 spec/support/initialized_client.rb
mrkt-1.2.1 spec/support/initialized_client.rb