Sha256: 9bcc0ccd4da8a2ae0896d48adda96fb28aad0c53fffb24f03a1a9c1cd86b5988
Contents?: true
Size: 1.27 KB
Versions: 34
Compression:
Stored size: 1.27 KB
Contents
# frozen_string_literal: true require 'spec_helpers/client' RSpec.describe FinApps::REST::DocumentsOrdersNotifications do include SpecHelpers::Client describe '#create' do subject(:notifications) { described_class.new(client) } context 'when missing id' do let(:create) { subject.create(nil) } it('returns missing argument error') do expect { create }.to raise_error(FinAppsCore::MissingArgumentsError) end end context 'when invalid id is provided' do let(:create) { subject.create(:invalid_id, ['1234']) } let(:results) { create[RESULTS] } let(:error_messages) { create[ERROR_MESSAGES] } it { expect { create }.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('order id is invalid') end end context 'with valid id' do let(:create) { subject.create(:valid_id, ['1234']) } let(:results) { create[RESULTS] } let(:error_messages) { create[ERROR_MESSAGES] } it { expect { create }.not_to raise_error } it('results is nil') { expect(results).to be_nil } it('error_messages array is empty') { expect(error_messages).to eq([]) } end end end
Version data entries
34 entries across 34 versions & 1 rubygems