Sha256: 8a38a95f0c978b47544b21beeb897629f0e08dd11279d4f1e0d355e4df1f279f

Contents?: true

Size: 548 Bytes

Versions: 4

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

RSpec.configure do |config|
  include ClientHelpers
end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
basecrm-1.2.3 spec/support/client_helpers.rb
basecrm-1.2.2 spec/support/client_helpers.rb
basecrm-1.2.1 spec/support/client_helpers.rb
basecrm-1.2.0 spec/support/client_helpers.rb