Sha256: d45c55c01a032bad5e4623c844748341dac35acd13328de1af3332ce7898fcea

Contents?: true

Size: 1.29 KB

Versions: 19

Compression:

Stored size: 1.29 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Zoom::Actions::Webinar do
  let(:zc) { zoom_client }
  let(:args) { { id: 'webinar_id', action: 'approve' } }

  describe '#webinar_registrants_status_update' do
    context 'with a valid response' do
      before :each do
        stub_request(
          :put,
          zoom_url("/webinars/#{args[:id]}/registrants/status")
        ).to_return(status: 204)
      end

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

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

    context 'with a 4xx response' do
      before :each do
        stub_request(
          :put,
          zoom_url("/webinars/#{args[:id]}/registrants/status")
        ).to_return(status: 404,
                    body: json_response('error', 'validation'),
                    headers: { 'Content-Type' => 'application/json' })
      end

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

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
zoom_rb-1.1.11 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.1.10 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.1.9 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.1.8 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.1.7 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.1.6 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.1.5 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.1.4 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.1.3 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.1.2 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.1.1 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.1.0 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.0.2 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.0.1 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-1.0.0 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-0.11.0 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_markazuna-0.10.0 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-0.10.0 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb
zoom_rb-0.9.1 spec/lib/zoom/actions/webinar/registrants/update_status_spec.rb