Sha256: 0f91cc003b37ea963b469a5a062135e7ef186608d57a05fa72a305c5157ae011

Contents?: true

Size: 606 Bytes

Versions: 2

Compression:

Stored size: 606 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Pipedrive::Operations::Update do
  subject do
    Class.new(Pipedrive::Base) do
      include Pipedrive::Operations::Update
    end.new('token')
  end

  describe '#create' do
    it 'calls #make_api_call' do
      expect(subject).to have_received(:make_api_call).with(:put, 12, { foo: 'bar' })
      subject.update(12, foo: 'bar')
    end

    it 'calls #make_api_call with id in params' do
      expect(subject).to have_received(:make_api_call).with(:put, 14, { foo: 'bar' })
      subject.update(foo: 'bar', id: 14)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pipedrive_api_rb-1.0.5 spec/lib/pipedrive/operations/update_spec.rb
pipedrive_api_rb-1.0.4 spec/lib/pipedrive/operations/update_spec.rb