Sha256: 9ff60da142ac6d408cc22773a06c05f6765d1a31bdb6f0a0f36b150b8938f303
Contents?: true
Size: 1.27 KB
Versions: 24
Compression:
Stored size: 1.27 KB
Contents
# frozen_string_literal: true require 'spec_helpers/client' RSpec.describe FinApps::REST::OrderTokens, 'initialized with valid FinApps::Client object' do include SpecHelpers::Client describe '#show' do subject(:order_tokens) { FinApps::REST::OrderTokens.new(client) } let(:results) { show[RESULTS] } let(:error_messages) { show[ERROR_MESSAGES] } context 'when missing token' do it do expect { subject.show(nil) }.to raise_error( FinAppsCore::MissingArgumentsError, ': token' ) end end context 'for valid token' do let(:show) { subject.show(:valid_token) } it { expect { show }.not_to raise_error } it('results is a Hash') { expect(results).to be_a(Hash) } it('results contains a consumer_id') do expect(results).to have_key(:consumer_id) end it('error_messages array is empty') { expect(error_messages).to eq([]) } end context 'for invalid token' do let(:show) { subject.show(:invalid_token) } it { expect { show }.not_to raise_error } it('results is nil') { expect(results).to be_nil } it('error messages array is populated') do expect(error_messages.first.downcase).to eq('resource not found') end end end end
Version data entries
24 entries across 24 versions & 1 rubygems