Sha256: 32cd673e497fee0d8045e10e7175de5e4ba2db895b6e847d01dff14883ea72b9

Contents?: true

Size: 719 Bytes

Versions: 11

Compression:

Stored size: 719 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
    @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

11 entries across 11 versions & 1 rubygems

Version Path
mrkt-1.2.0 spec/support/initialized_client.rb
mrkt-1.1.1 spec/support/initialized_client.rb
mrkt-1.1.0 spec/support/initialized_client.rb
mrkt-1.0.1 spec/support/initialized_client.rb
mrkt-1.0.0 spec/support/initialized_client.rb
mrkt-0.11.1 spec/support/initialized_client.rb
mrkt-0.11.0 spec/support/initialized_client.rb
mrkt-0.10.0 spec/support/initialized_client.rb
mrkt-0.9.0 spec/support/initialized_client.rb
mrkt-0.8.0 spec/support/initialized_client.rb
mrkt-0.7.0 spec/support/initialized_client.rb