spec/rest/plaid/plaid_webhooks_spec.rb in finapps-5.0.9 vs spec/rest/plaid/plaid_webhooks_spec.rb in finapps-5.0.10

- old
+ new

@@ -1,28 +1,22 @@ # frozen_string_literal: true require 'spec_helpers/client' +require 'rest/api_request' RSpec.describe FinApps::REST::PlaidWebhooks do include SpecHelpers::Client let(:api_client) { client } subject(:show) { FinApps::REST::PlaidWebhooks.new(api_client).show } describe '#show' do - RSpec.shared_examples 'an API request' do |_parameter| - it { expect { show }.not_to raise_error } - it('returns an array') { expect(show).to be_a(Array) } - end - context 'when valid tenant token is provided' do it_behaves_like 'an API request' + it_behaves_like 'a successful request' it('performs a post and returns the webhook url') do expect(show[RESULTS]).to have_key(:url) - end - it('returns no error messages') do - expect(show[ERROR_MESSAGES]).to be_empty end end context 'when invalid tenant token is provided' do let(:api_client) { client(:invalid_tenant_token) }