Sha256: 28b16cc34ec7dcddb791ef49095339c0b50faff4a2183c5da25e71afafc4e0cb

Contents?: true

Size: 951 Bytes

Versions: 26

Compression:

Stored size: 951 Bytes

Contents

# frozen_string_literal: true

require 'spec_helpers/client'
require 'rest/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

26 entries across 26 versions & 1 rubygems

Version Path
finapps-6.4.3 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.4.2 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.4.1 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.4.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.3.1 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.3.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.2.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.1.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-6.0.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.4.1 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.4.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.3.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.2.1 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.2.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.1.0 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.47 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.46 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.45 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.44 spec/rest/plaid/plaid_webhooks_spec.rb
finapps-5.0.43 spec/rest/plaid/plaid_webhooks_spec.rb