Skip to content

Commit

Permalink
Merge pull request #468 from kfitzpatrick/delete-meeting-registrant
Browse files Browse the repository at this point in the history
Adds a meeting_delete_registrant action
  • Loading branch information
kyleboe authored Jan 12, 2024
2 parents 95643f6 + ebd36d9 commit a25fe9c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/zoom/actions/meeting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ module Meeting
language occurrence_ids auto_approve
]

# Delete a meeting registrant.
delete 'meeting_delete_registrant', '/meetings/:meeting_id/registrants/:registrant_id'

# Register up to 30 registrants at once for a meeting that requires registration.
post 'batch_registrants', '/meetings/:meeting_id/batch_registrants',
permit: %i[registrants auto_approve registrants_confirmation_email]
Expand Down
30 changes: 30 additions & 0 deletions spec/lib/zoom/actions/meeting/delete_registrant_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# frozen_string_literal: true

require 'spec_helper'

describe Zoom::Actions::Meeting do
let(:zc) { zoom_client }
let(:args) { { meeting_id: 1, registrant_id: 'abcdef' } }

describe '#meeting_delete_registrant action' do
before :each do
stub_request(
:delete,
zoom_url("/meetings/#{args[:meeting_id]}/registrants/#{args[:registrant_id]}")
).to_return(status: 204, headers: { 'Content-Type' => 'application/json' })
end

it "requires a 'meeting_id' and 'registrant_id' argument" do
expect {
zc.meeting_delete_registrant(filter_key(args, :meeting_id))
}.to raise_error(Zoom::ParameterMissing)
expect {
zc.meeting_delete_registrant(filter_key(args, :registrant_id))
}.to raise_error(Zoom::ParameterMissing)
end

it 'returns a status code of 204' do
expect(zc.meeting_delete_registrant(args)).to eq(204)
end
end
end

0 comments on commit a25fe9c

Please sign in to comment.