Sha256: f37c38b1ea54c17abedf30c0fa12887b328966bdce0b829c9e1e648b1b83c600

Contents?: true

Size: 975 Bytes

Versions: 3

Compression:

Stored size: 975 Bytes

Contents

require 'intercom'
require 'minitest/autorun'

describe "api.intercom.io dummy data requests" do
  before :each do
    Intercom.app_id = "dummy-app-id"
    Intercom.api_key = "dummy-secret-key"
  end

  it "should get a user" do
    user = Intercom::User.find(:email => "somebody@example.com")
    user.name.must_equal "Somebody"
  end

  it "not found... " do
    proc { Intercom::User.find(:email => "not-found@example.com") }.must_raise Intercom::ResourceNotFound
  end

  it "server error" do
    proc { Intercom::User.find(:email => "server-error@example.com") }.must_raise Intercom::ServerError
  end

  it "authentication failure with bad api key" do
    Intercom.app_id = "bad-app-id"
    Intercom.api_key = "bad-secret-key"
    proc { Intercom::User.find(:email => "not-found@example.com") }.must_raise Intercom::AuthenticationError
  end

  it "should find_all messages for a user" do
    Intercom::MessageThread.find_all(:email => "somebody@example.com")
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
intercom-0.0.5 spec/integration/intercom_api_integration_spec.rb
intercom-0.0.4 spec/integration/intercom_api_integration_spec.rb
intercom-0.0.3 spec/integration/intercom_api_integration_spec.rb