Sha256: 4bca4d63bef27d122ee3d5f2a4b8bdefac0b708937580eecf3d8a244b41da304
Contents?: true
Size: 1.27 KB
Versions: 19
Compression:
Stored size: 1.27 KB
Contents
# frozen_string_literal: true require 'spec_helper' describe Zoom::Actions::User do let(:zc) { zoom_client } let(:args) { { id: 'eIimBAXqSrWOcB_EOIXTog', first_name: 'Bar', last_name: 'Foo' } } describe '#user_update' do context 'with a valid response' do before :each do stub_request( :patch, zoom_url("/users/#{args[:id]}") ).to_return(status: 204, body: json_response('user', 'update'), headers: { 'Content-Type' => 'application/json' }) end it 'requires id param' do expect { zc.user_update(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.user_update(args)).to eql(204) end end context 'with a 4xx response' do before :each do stub_request( :patch, zoom_url("/users/#{args[:id]}") ).to_return(status: 404, body: json_response('error', 'validation'), headers: { 'Content-Type' => 'application/json' }) end it 'raises an error' do expect { zc.user_update(args) }.to raise_error(Zoom::Error) end end end end
Version data entries
19 entries across 19 versions & 2 rubygems