Sha256: 6bd1f7501bf3e72942c88f45de258f83bbba6f2bfd4ee1dbff64b24fefc28a19
Contents?: true
Size: 1.24 KB
Versions: 16
Compression:
Stored size: 1.24 KB
Contents
# frozen_string_literal: true require 'spec_helper' describe Zoom::Actions::Account do let(:zc) { zoom_client } let(:args) { { account_id: 1 } } describe '#account_delete action' do context 'with a valid response' do before :each do stub_request( :delete, zoom_url("/accounts/#{args[:account_id]}") ).to_return(status: 204, body: json_response('account', 'delete'), headers: { 'Content-Type' => 'application/json' }) end it 'requires the account_id params' do expect { zc.account_delete }.to raise_error(Zoom::ParameterMissing, [:account_id].to_s) end it 'returns the http status code as a number' do expect(zc.account_delete(args)).to eql(204) end end context 'with a 4xx response' do before :each do stub_request( :delete, zoom_url("/accounts/#{args[:account_id]}") ).to_return(status: 400, body: json_response('error', 'not_found'), headers: { 'Content-Type' => 'application/json' }) end it 'raises Zoom::Error exception' do expect { zc.account_delete(args) }.to raise_error(Zoom::Error) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems