Sha256: e48796037da901e9f406dac069fc88981dec205445c01fe2872a026b18540e2f

Contents?: true

Size: 1.2 KB

Versions: 1

Compression:

Stored size: 1.2 KB

Contents

require 'intercom'
require 'minitest/autorun'
require 'mocha'
require 'pry'
IRB = Pry

module Intercom
  def self.mock_rest_client=(client)
    @mock_rest_client = client
  end

  def self.execute_request(method, path, params = {}, headers= {}, payload = nil)
    case method
      when :get then @mock_rest_client.get(path, params)
      when :post then @mock_rest_client.post(path, params, headers, payload)
    end
  end
end

def test_user
  {
      :user_id => 'mysql-id-from-customers-app for eg', # can request by this
      :email => "bo@example.com", # can request by this
      :session_count => 123, # can't be sent - but can get...
      :created_at => 1323422442,
      :last_request_at => 1323422442,
      :name => "Joe Schmoe",
      :social_accounts => {
          "twitter" => [{"url" => "http://twitter.com/abc", "username" => "abc"}, {"username" => "abc2", "url" => "http://twitter.com/abc2"}],
          "facebook" => [{"url" => "http://facebook.com/abc", "username" => "abc", "id" => "1234242"}],
          "quora" => [{"url" => "http://facebook.com/abc", "username" => "abc", "id" => "1234242"}]
      },
      :custom_data => {"a" => 1, "b" => {"nested-hash" => ["ab", 12, {"deep" => "man"}]}}
  }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
intercom-0.0.1 spec/spec_helper.rb