Sha256: 5372f633466fbb65e75f745a873c408b7640ea9969fab838ef5513c0c1014919
Contents?: true
Size: 1.42 KB
Versions: 8
Compression:
Stored size: 1.42 KB
Contents
require 'spec_helper' describe BaseCRM::CallsService do describe 'Responds to' do subject { client.calls } it { should respond_to :all } it { should respond_to :create } it { should respond_to :destroy } it { should respond_to :find } it { should respond_to :update } it { should respond_to :where } end describe :all do it "returns a PaginatedResource" do expect(client.calls.all()).to be_instance_of BaseCRM::PaginatedResource end end describe :where do it "returns an array" do expect(client.calls.where(page: 1)).to be_an Array end end describe :create do it "returns instance of Call class" do @call = build(:call) expect(client.calls.create(@call)).to be_instance_of BaseCRM::Call end end describe :find do before :each do @call = create(:call) end it "returns an instance of Call class" do expect(client.calls.find(@call.id)).to be_instance_of BaseCRM::Call end end describe :update do it "returns an updated instance of Call class" do @call = create(:call) contact = create(:contact) expect(client.calls.update(id: @call.id, resource_type: "contact", resource_id: contact.id)).to be_instance_of BaseCRM::Call end end describe :destroy do it "returns true on success" do @call = create(:call) expect(client.calls.destroy(@call.id)).to be_truthy end end end
Version data entries
8 entries across 8 versions & 1 rubygems