Sha256: 743e3ab734c066a19f080b13a8df84fa433fd87c75bdb6775a32309049b583c1

Contents?: true

Size: 962 Bytes

Versions: 22

Compression:

Stored size: 962 Bytes

Contents

# 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
    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
    end

    context 'when invalid tenant token is provided' do
      let(:api_client) { client(:invalid_tenant_token) }

      it_behaves_like 'an API request'

      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(
          'invalid tenant api key or secret'
        )
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
finapps-5.0.32 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.31 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.30 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.29 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.28 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.27 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.26 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.25 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.24 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.23 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.22 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.21 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.20 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.19 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.17 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.16 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.15 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.14 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.13 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.12 spec/rest/plaid/plaid_webhooks_spec.rb