Sha256: 73b39339b42632eee3c33100d83fc5037046d0cbbec4cc55b986e2888e4b0b87

Contents?: true

Size: 739 Bytes

Versions: 35

Compression:

Stored size: 739 Bytes

Contents

require "spec_helper"

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

  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 me (access token method only)" do
    client.expects(:get).with("/me", {}).returns(test_admin)
    client.admins.me
  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

35 entries across 35 versions & 1 rubygems

Version Path
intercom-3.9.5 spec/unit/intercom/admin_spec.rb
intercom-3.9.4 spec/unit/intercom/admin_spec.rb
intercom-3.9.3 spec/unit/intercom/admin_spec.rb
intercom-3.9.2 spec/unit/intercom/admin_spec.rb
intercom-3.9.0 spec/unit/intercom/admin_spec.rb
intercom-3.8.1 spec/unit/intercom/admin_spec.rb
intercom-3.8.0 spec/unit/intercom/admin_spec.rb
intercom-3.7.7 spec/unit/intercom/admin_spec.rb
intercom-3.7.6 spec/unit/intercom/admin_spec.rb
intercom-3.7.5 spec/unit/intercom/admin_spec.rb
intercom-3.7.4 spec/unit/intercom/admin_spec.rb
intercom-3.7.3 spec/unit/intercom/admin_spec.rb
intercom-3.7.2 spec/unit/intercom/admin_spec.rb
intercom-3.7.1 spec/unit/intercom/admin_spec.rb
intercom-3.7.0 spec/unit/intercom/admin_spec.rb
intercom-3.6.2 spec/unit/intercom/admin_spec.rb
intercom-3.6.1 spec/unit/intercom/admin_spec.rb
intercom-3.6.0 spec/unit/intercom/admin_spec.rb
intercom-3.5.26 spec/unit/intercom/admin_spec.rb
intercom-3.5.25 spec/unit/intercom/admin_spec.rb