Sha256: 2184d2082249c7c56f775f2cc525a3213a9940578728503d171ca13fcc1fb7ee
Contents?: true
Size: 1.1 KB
Versions: 40
Compression:
Stored size: 1.1 KB
Contents
# frozen_string_literal: true RSpec.describe FinApps::REST::OrderStatuses do include SpecHelpers::Client describe '#show' do context 'when missing id' do subject(:show) { described_class.new(client).show(nil) } it do expect { show }.to raise_error(FinAppsCore::MissingArgumentsError) end end context 'when valid id is provided' do subject(:show) { described_class.new(client).show(:valid_id) } it { expect { show }.not_to raise_error } it('performs a get and returns the response') do expect(show[RESULTS]).to have_key(:status) end it('returns no error messages') do expect(show[ERROR_MESSAGES]).to be_empty end end context 'when invalid id is provided' do subject(:show) { described_class.new(client).show(:invalid_id) } it { expect { show }.not_to raise_error } it('results is nil') { expect(show[RESULTS]).to be_nil } it('error messages array is populated') do expect(show[ERROR_MESSAGES].first.downcase).to eq( 'resource not found' ) end end end end
Version data entries
40 entries across 40 versions & 1 rubygems