Sha256: b78d73f2701d76d136b0c598ada5ed3ad49385a0444fa0d80a347cc713e350d1

Contents?: true

Size: 550 Bytes

Versions: 6

Compression:

Stored size: 550 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 ||= FactoryGirl.create(:contact)
  end
end

RSpec.configure do |config|
  include ClientHelpers
end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
basecrm-1.3.5 spec/support/client_helpers.rb
basecrm-1.3.4 spec/support/client_helpers.rb
basecrm-1.3.3 spec/support/client_helpers.rb
basecrm-1.3.2 spec/support/client_helpers.rb
basecrm-1.3.1 spec/support/client_helpers.rb
basecrm-1.3.0 spec/support/client_helpers.rb