spec/unit/intercom/admin_spec.rb in intercom-2.5.4 vs spec/unit/intercom/admin_spec.rb in intercom-3.0.0b1
- old
+ new
@@ -1,9 +1,16 @@
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
- Intercom.expects(:execute_request).never
- all = Intercom::Admin.all
- all.must_be_instance_of(Intercom::CollectionProxy)
+ client.expects(:execute_request).never
+ all = client.admins.all
+ all.must_be_instance_of(Intercom::ClientCollectionProxy)
end
-end
\ No newline at end of file
+
+ it 'gets an admin list' do
+ client.expects(:get).with("/admins", {}).returns(test_admin_list)
+ client.admins.all.each { |a| }
+ end
+end