Sha256: 003025dc01fbff0a479e9f0f29655ad718ca56623b55532cdd46224c2465466c

Contents?: true

Size: 628 Bytes

Versions: 3

Compression:

Stored size: 628 Bytes

Contents

require "spec_helper"

describe "Intercom::Admin" do
  let (:client) { Intercom::Client.new(app_id: 'app_id',  api_key: 'api_key') }

  it "returns a CollectionProxy for all without making any requests" do
    client.expects(:execute_request).never
    all = client.admins.all
    all.must_be_instance_of(Intercom::ClientCollectionProxy)
  end

  it 'gets an admin list' do
    client.expects(:get).with("/admins", {}).returns(test_admin_list)
    client.admins.all.each { |a| }
  end

  it "gets an admin" do
    client.expects(:get).with("/admins/1234", {}).returns(test_admin)
    client.admins.find(:id => "1234")
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
intercom-3.5.7 spec/unit/intercom/admin_spec.rb
intercom-3.5.6 spec/unit/intercom/admin_spec.rb
intercom-3.5.5 spec/unit/intercom/admin_spec.rb