Sha256: a1a529cad3d6e7230feaab3147295fad2d5385121e6f3f83fa05bfb4232d08d6

Contents?: true

Size: 959 Bytes

Versions: 16

Compression:

Stored size: 959 Bytes

Contents

# frozen_string_literal: true

require 'spec_helpers/client'
require 'spec_helpers/api_request'

RSpec.describe FinApps::REST::PlaidWebhooks do
  include SpecHelpers::Client

  subject(:show) { described_class.new(api_client).show }

  let(:api_client) { client }

  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

16 entries across 16 versions & 1 rubygems

Version Path
finapps-6.13.1 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.13.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.12.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.11.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.10.2 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.10.1 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.10.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.9.2 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.9.1 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.9.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.8.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.7.1 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.7.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.6.1 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.6.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.5.0 spec/rest/plaid/plaid_webhooks_spec.rb