Sha256: 831e9b0102569f1a83b70344491a0fb937453ff56c6ca752a7d0496739492dc1

Contents?: true

Size: 548 Bytes

Versions: 5

Compression:

Stored size: 548 Bytes

Contents

module ClientHelpers
  def client
    @client ||= BaseCRM::Client.new(access_token: access_token, base_url: base_url)
  end

  def access_token
    @access_token ||= ENV.fetch("BASECRM_ACCESS_TOKEN") { raise '"BASECRM_ACCESS_TOKEN" has not been found.'  }
  end

  def base_url
    @basecrm_url ||= ENV.fetch("BASECRM_BASE_URL") { "https://api.getbase.com" }
  end

  def contact
    @contact ||= FactoryBot.create(:contact)
  end
end

RSpec.configure do |config|
  include ClientHelpers
end

FactoryBot::SyntaxRunner.send(:include, ClientHelpers)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
basecrm-1.3.10 spec/support/client_helpers.rb
basecrm-1.3.9 spec/support/client_helpers.rb
basecrm-1.3.8 spec/support/client_helpers.rb
basecrm-1.3.7 spec/support/client_helpers.rb
basecrm-1.3.6 spec/support/client_helpers.rb