forked from kyleboe/zoom_rb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kyleboe#471 from nm/delete-webinar-registrant
Add a webinar_registrant_delete action
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
RSpec.describe Zoom::Actions::Webinar do | ||
let(:zc) { zoom_client } | ||
let(:args) { { webinar_id: 1, registrant_id: 'abcdef' } } | ||
|
||
describe '#webinar_registrant_delete action' do | ||
before :each do | ||
stub_request( | ||
:delete, | ||
zoom_url("/webinars/#{args[:webinar_id]}/registrants/#{args[:registrant_id]}") | ||
).to_return(status: 204, headers: { 'Content-Type' => 'application/json' }) | ||
end | ||
|
||
it "requires a 'webinar_id' and 'registrant_id' argument" do | ||
expect { | ||
zc.webinar_registrant_delete(filter_key(args, :webinar_id)) | ||
}.to raise_error(Zoom::ParameterMissing) | ||
expect { | ||
zc.webinar_registrant_delete(filter_key(args, :registrant_id)) | ||
}.to raise_error(Zoom::ParameterMissing) | ||
end | ||
|
||
it 'returns a status code of 204' do | ||
expect(zc.webinar_registrant_delete(args)).to eq(204) | ||
end | ||
end | ||
end |