Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions unit/e2e_tests/ruby/spec/models/api_token_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
require 'spec_helper'
require 'json'
require 'date'

# Unit tests for OpenapiClient::ApiToken
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
RSpec.describe 'ApiToken' do
before do
configure_tests
end

describe 'test an instance of Org ApiToken' do
let(:api_instance) { OpenapiClient::CreateOrgApiTokenApi.new(OpenapiClient::ApiClient.new(configuration)) }
it 'should create an instance of ApiToken' do
request = {data: OpenapiClient::CreateApiToken.new( type: "apiToken", attributes: OpenapiClient::CreateApiTokenAttributes.new(
{description: "test token", scope: "customers applications",
expiration: "2023-11-21T13:47:17.000Z", source_ip: "192.11.1.1"})).to_hash}
response = api_instance.execute("4148", request)
expect(response.data.type).to eq('apiToken')
end
end

describe 'list api tokens' do
let(:list_instance) { OpenapiClient::GetListOrgAPITokensApi.new(OpenapiClient::ApiClient.new(configuration)) }

it 'lists api tokens' do
opts = { query_params: {"page[limit]": 10, "page[offset]": 0, "userId": "4148"}}
response = list_instance.execute(opts)
expect(response.data[0].type).to eq('apiToken')
end
end

describe 'test an instance of customer token' do
let(:customer_instance) {OpenapiClient::CreateCustomerTokenApi.new(OpenapiClient::ApiClient.new(configuration)) }
let(:verification_instance) {OpenapiClient::CreateCustomerTokenVerificationApi.new(OpenapiClient::ApiClient.new(configuration))}
let(:verification_request) do {data: OpenapiClient::CreateCustomerTokenVerification.new(type: "customerTokenVerification", attributes: OpenapiClient::CreateCustomerTokenVerificationAttributes.new(channel: "sms")).to_hash} end
let(:verification_token) {verification_instance.execute("768867", verification_request)}
it 'should create an instance of ApiToken' do
request = {data: OpenapiClient::CreateCustomerToken.new( type: "customerToken", attributes: OpenapiClient::CreateCustomerTokenAttributes.new(
{verification_token: verification_token, scope: "customers applications"})).to_hash}
response = customer_instance.execute("768867", request)
expect(response.data.type).to eq('customerToken')
end
end
end
31 changes: 31 additions & 0 deletions unit/e2e_tests/ruby/spec/models/application_form_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
require 'spec_helper'
require 'json'
require 'date'

# Unit tests for OpenapiClient::ApplicationForm
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
RSpec.describe 'ApplicationForm' do
before do
configure_tests
end

describe 'test an instance of ApplicationForm' do
let(:api_instance) { OpenapiClient::GetApplicationFormApi.new(OpenapiClient::ApiClient.new(configuration)) }

it 'should get an instance of ApplicationForm' do
response = api_instance.execute('803451')
expect(response.data.type).to eq('applicationForm')
end
end

describe 'list application forms' do
let(:api_instance) { OpenapiClient::GetListApplicationFormsApi.new(OpenapiClient::ApiClient.new(configuration)) }

it 'should list an instance of ApplicationForm' do
opts = { query_params: {"page[limit]": 10, "page[offset]": 0, "filter[email]": '[email protected]'}}
response = api_instance.execute(opts)
expect(response.data[0].type).to eq('applicationForm')
end
end
end
15 changes: 14 additions & 1 deletion unit/e2e_tests/ruby/spec/models/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@
expect(response.data.type).to eq('individualApplication')
end

it 'should list applications' do
api_instance = OpenapiClient::GetListApplicationsApi.new(client)
opts = { query_params: { 'filter[customer_id]': '836683' } }
response = api_instance.execute(opts)
expect(response.data[0].type).to eq('individualApplication')
end

it 'should get an individual application' do
api_instance = OpenapiClient::GetApplicationApi.new(client)
response = api_instance.execute("824008")
expect(response.data.type).to eq("individualApplication")
end

it 'should upload a document for the application' do
api_instance = OpenapiClient::UploadAPDFDocumentForAnApplicationApi.new(client)
request = api_instance.execute('836683', '125214', get_document_contents)
Expand All @@ -44,4 +57,4 @@
expect(request.data.type).to eq('document')
end
end
end
end
48 changes: 48 additions & 0 deletions unit/e2e_tests/ruby/spec/models/atm_location_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# frozen_string_literal: true

require 'openapi_client'
require_relative '../spec_helper'
require 'json'
require 'date'

RSpec.describe 'ATMLocation' do
before do
# run before each test
configure_tests
end

describe 'get ATM locations' do
let(:api_instance) { OpenapiClient::GetATMLocationsListApi.new(OpenapiClient::ApiClient.new(configuration)) }


it 'should get ATM locations by coordinates' do
opts = {
query_params: {
'filter[postalCode]': "02139",
'filter[searchRadius]': 30
} }
response = api_instance.execute(opts)
expect(response.data.type).to eq('atmLocation')
end

it 'should get ATM locations by coordinates' do
search_radius = 30

coordinates = OpenapiClient::Coordinates.new({ latitude: 40.730610, longitude: -71.935242 })

coordinates_json = coordinates.to_hash.to_json

opts = {
query_params: {
'filter[coordinates]': coordinates_json,
'filter[searchRadius]': search_radius
}
}

response = api_instance.execute(opts)
response[:data].each do |atm_location|
expect(atm_location[:type]).to eq('atmLocation')
end
end
end
end
10 changes: 5 additions & 5 deletions unit/e2e_tests/ruby/spec/models/card_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
{ shipping_address: ADDRESS, tags: { "purpose": 'checking' },
additional_embossed_text: 'additional_text', expiry_date: '03/27' }
),
relationships: OpenapiClient::CardRelationships.new(account: { "data": { "type": 'depositAccount',
"id": '2002413' } })).to_hash }
relationships: OpenapiClient::Relationships.new(account: { "data": { "type": 'depositAccount',
"id": '2002413' } })).to_hash }
response = api_instance.execute(request)
expect(response.data.type).to eq('individualDebitCard')
end
Expand All @@ -31,10 +31,10 @@
tags: { "purpose": 'business' }, limits: LIMITS, idempotency_key: '1234567890',
print_only_business_name: false, expiry_date: '03/27' }
),
relationships: OpenapiClient::CardRelationships.new(account: { "data": { "type": 'account',
"id": '1567861' } })).to_hash }
relationships: OpenapiClient::Relationships.new(account: { "data": { "type": 'account',
"id": '1567861' } })).to_hash }
response = api_instance.execute(request)
expect(response.data.type).to eq('businessDebitCard')
end
end
end
end
58 changes: 58 additions & 0 deletions unit/e2e_tests/ruby/spec/models/check_deposit_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
require 'spec_helper'
require 'json'
require 'date'

# Unit tests for OpenapiClient::CheckDeposit
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
RSpec.describe 'CheckDeposit' do
before do
configure_tests
end

describe 'test an instance of CheckDeposit' do
let(:api_instance) { OpenapiClient::CreateCheckDepositApi.new(OpenapiClient::ApiClient.new(configuration)) }

it 'should create a checkDeposit' do
request = { data: OpenapiClient::CreateCheckDeposit.new(type: 'checkDeposit',
attributes:
OpenapiClient::CreateCheckDepositAttributes.new(
{ amount: 100,
description: 'test',
tags: { "purpose": 'tax' },
idempotency_key: '1234567890' }),
relationships: OpenapiClient::CreateCheckDepositRelationships.new(
account: { "data": { "type": 'account', "id": '2110693' } })).to_hash }
response = api_instance.execute(request)
expect(response.data.type).to eq('checkDeposit')
end
end

describe 'list checkDeposits' do
let(:api_instance) { OpenapiClient::GetCheckDepositApi.new(OpenapiClient::ApiClient.new(configuration)) }

it 'should get a checkDeposit' do
response = api_instance.execute('16558')
expect(response.data.type).to eq('checkDeposit')
end

it 'should list checkDeposits' do
opts = { query_params: {"page[limit]": 10, "page[offset]": 0, "filter[status]": 'pending'}}
response = api_instance.execute(opts)
expect(response.data[0].type).to eq('checkDeposit')
end
end

describe 'update checkDeposit' do
let(:instance) { OpenapiClient::UpdateCheckDepositApi.new(OpenapiClient::ApiClient.new(configuration)) }

it 'should update a checkDeposit' do
request = { data: OpenapiClient::PatchCheckDeposit.new(attributes:
OpenapiClient::PatchCheckDepositAttributes.new(
tags: { "status": "Awaiting Customer Confirmation",
"id": "23033b64-38f8-4dbc-91a1-313ff0156d02" })).to_hash }
response = instance.execute('16558', request)
expect(response.data.type).to eq('checkDeposit')
end
end
end
31 changes: 31 additions & 0 deletions unit/e2e_tests/ruby/spec/models/counterparty_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
require 'spec_helper'
require 'json'
require 'date'

# Unit tests for OpenapiClient::Counterparty
RSpec.describe 'Counterparty' do
before do
configure_tests
end

describe 'test an instance of Counterparty' do
let(:api_instance) { OpenapiClient::CreateCounterpartyApi.new(OpenapiClient::ApiClient.new(configuration)) }

it 'should create an instance of Counterparty' do
request = { data: OpenapiClient::CreatePlaidCounterparty.new(type: 'achCounterparty',
attributes:
OpenapiClient::CreatePlaidCounterpartyAttributes.new(
{type: "Business",
name: 'test',
tags: { "purpose": 'tax' },
idempotency_key: '1234567890',
plaid_processor_token: 'processor-sandbox-7179b936-476c-4b3c-a2f8-8255d8cd5b5b'}),
relationships: OpenapiClient::CreateCounterpartyRelationships.new(
customer: { "data": { "type": 'customer',
"id": '823139' } }
).to_hash).to_hash }
response = api_instance.execute(request)
expect(response.data.type).to eq('achCounterparty')
end
end
end
3 changes: 1 addition & 2 deletions unit/e2e_tests/ruby/spec/models/customer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,5 @@

expect(response.data[0].type).to eq('individualCustomer')
end

end
end
end
20 changes: 20 additions & 0 deletions unit/e2e_tests/ruby/spec/models/event_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require 'spec_helper'

# Unit tests for OpenapiClient::Event
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
RSpec.describe 'Event' do
before do
configure_tests
end

describe 'test an instance of Event' do

let(:api_instance) { OpenapiClient::GetEventApi.new(OpenapiClient::ApiClient.new(configuration)) }

it 'should create an instance of Event' do
response = api_instance.execute('15543784')
expect(response.data.type).to eq("transaction.created")
end
end
end
23 changes: 23 additions & 0 deletions unit/e2e_tests/ruby/spec/models/fee_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
require 'spec_helper'

# Unit tests for OpenapiClient::Fee
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
RSpec.describe 'Fee' do
before do
configure_tests
end

describe 'test an instance of Fee' do
let(:api_instance) { OpenapiClient::CreateFeeApi.new(OpenapiClient::ApiClient.new(configuration)) }
it 'should create an instance of Fee' do
request = { data: OpenapiClient::CreateFee.new(type: 'fee', attributes: OpenapiClient::CreateFeeAttributes.new(
{ amount: 100, description: 'test', tags: { "purpose": 'tax' }, idempotency_key: "13848484884" } ),
relationships: OpenapiClient::FeeRelationships.new(
account: { "data": { "type": 'account', "id": '36099' } }
)).to_hash }
response = api_instance.execute(request)
expect(response.data.type).to eq('fee')
end
end
end
9 changes: 5 additions & 4 deletions unit/e2e_tests/ruby/spec/models/payment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,26 @@
it 'should create an instance of BookPayment' do
request = { data: OpenapiClient::CreateBookPayment.new(type: 'bookPayment', attributes:
OpenapiClient::CreateBookPaymentAttributes.new(amount: 1000, description: 'test payment', tags: { "test": 'test-tag' }),
relationships: OpenapiClient::CreateBookPaymentRelationships.new(account: { "data": { "type": 'depositAccount', "id": '27573' } }, counterparty_account: { "data": { "type": 'depositAccount', "id": '36981' } }).to_hash).to_hash }
relationships: OpenapiClient::CreateBookPaymentRelationships.new(account: { "data": { "type": 'depositAccount', "id": '27573' } }, counterparty_account: { "data": { "type": 'depositAccount', "id": '36981' } })).to_hash }
response = api_instance.execute(request)
expect(response.data.type).to eq('bookPayment')
end

it 'should create an instance of AchPayment' do
request = { data: OpenapiClient::CreateAchPayment.new(type: 'achPayment', attributes:
OpenapiClient::CreateAchPaymentAttributes.new(amount: 1000, direction: 'Credit', counterparty: OpenapiClient::Counterparty.new(name: 'Jane Doe', routing_number: '812345678', account_number: '27573', account_type: 'Checking'), description: 'test payment'),
relationships: OpenapiClient::CreateAchPaymentRelationships.new(account: { "data": { "type": 'account', "id": '27573' } }).to_hash).to_hash }
relationships: OpenapiClient::CreateAchPaymentRelationships.new(account: { "data": { "type": 'account', "id": '27573' } })).to_hash }
response = api_instance.execute(request)
expect(response.data.type).to eq('achPayment')
end

it 'should create an instance of AchPayment with plaid token' do
request = { data: OpenapiClient::CreateAchPaymentPlaid.new(type: 'achPayment', attributes:
OpenapiClient::CreateAchPaymentPlaidAttributes.new(amount: 1000, direction: 'Credit', description: 'test payment', plaid_processor_token: 'processor-sandbox-1424a3b1-2b56-4d46-9e11-1fdc70fd3724'),
relationships: OpenapiClient::CreateAchPaymentRelationships.new(account: { "data": { "type": 'depositAccount', "id": '27573' } }).to_hash).to_hash }
relationships: OpenapiClient::CreateAchPaymentRelationships.new(account: { "data": { "type": 'depositAccount', "id": '27573' } })).to_hash }
response = api_instance.execute(request)

expect(response.data.type).to eq('achPayment')
end
end
end
end
31 changes: 31 additions & 0 deletions unit/e2e_tests/ruby/spec/models/recurring_payment_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
require_relative '../spec_helper'
require 'json'
require 'date'

# Unit tests for OpenapiClient::RecurringDebitAchPayment
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
RSpec.describe 'RecurringPayment' do
before do
# run before each test
configure_tests
end

let(:ach_instance) { OpenapiClient::CreateRecurringPaymentApi.new(OpenapiClient::ApiClient.new(configuration)) }

describe 'test an instance of RecurringDebitAchPayment' do
it 'should create an instance of RecurringDebitAchPayment' do
schedule = OpenapiClient::Schedule.new(interval: 'Monthly', day_of_month: 3 )
request = {data: OpenapiClient::CreateRecurringDebitAchPayment.new(type: "recurringDebitAchPayment", attributes:
OpenapiClient::CreateRecurringDebitAchPaymentAttributes.new({amount: 1000, description: "test pay",
schedule: schedule},
), relationships: OpenapiClient::CreateAchPaymentCounterpartyRelationships.new(
account: {data: {type: "account", id: "27573"}}, counterparty:
{data: {type: "counterparty", id: "679784"}}
)
).to_hash }
response = ach_instance.execute(request)
expect(response.data.type).to eq("recurringDebitAchPayment")
end
end
end
Loading