Sha256: 3954cbdbacd7f11caffe4c173e51cbd38028b91f34e3408fdb52304cdb9ee64d

Contents?: true

Size: 688 Bytes

Versions: 5

Compression:

Stored size: 688 Bytes

Contents

require 'securerandom'
require 'json'

shared_context 'initialized client' do
  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

  subject(:client) { Mrkt::Client.new(host: host, client_id: client_id, client_secret: client_secret) }

  before do
    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

5 entries across 5 versions & 1 rubygems

Version Path
mrkt-0.6.2 spec/support/initialized_client.rb
mrkt-0.6.1 spec/support/initialized_client.rb
mrkt-0.6.0 spec/support/initialized_client.rb
mrkt-0.5.0 spec/support/initialized_client.rb
mrkt-0.4.0 spec/support/initialized_client.rb