Sha256: a97b493403a1e795f1d04aba00c02ebb3d523225a612e0427b5a0d22f96f2c21

Contents?: true

Size: 987 Bytes

Versions: 1

Compression:

Stored size: 987 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Zoom::Actions::Webinar do
  let(:zc) { zoom_client}
  let(:args) { { id: '123456789' } }

  describe '#webinar_delete' do
    before :each do
      stub_request(
        :delete,
        zoom_url("/webinars/#{args[:id]}")
      ).to_return(status: 204, body: json_response('webinar', 'delete'))
    end

    it "requires a 'id' argument" do
      expect { zc.webinar_delete(filter_key(args, :id)) }.to raise_error(Zoom::ParameterMissing, [:id].to_s)
    end

    it 'returns the http status code as a number' do
      expect(zc.webinar_delete(args)).to eql(204)
    end
  end

  describe '#webinar_delete!' do
    before :each do
      stub_request(
        :delete,
        zoom_url("/webinars/#{args[:id]}")
      ).to_return(body: json_response('error', 'validation'))
    end

    it 'raises Zoom::Error exception' do
      expect {
        zc.webinar_delete!(args)
      }.to raise_error(Zoom::Error)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
zoom_rb-0.8.1 spec/lib/zoom/actions/webinar/delete_spec.rb