|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | | -require 'openapi_client' |
| 3 | +require 'unit_openapi_ruby_sdk' |
4 | 4 | require_relative '../spec_helper' |
5 | 5 |
|
6 | 6 | RSpec.describe 'Card' do |
|
9 | 9 | end |
10 | 10 |
|
11 | 11 | describe 'test an instance of CreateCard' do |
12 | | - let(:api_instance) { OpenapiClient::UnitApi.new(OpenapiClient::ApiClient.new(configuration)) } |
| 12 | + let(:api_instance) { UnitOpenapiRubySdk::UnitApi.new(UnitOpenapiRubySdk::ApiClient.new(configuration)) } |
13 | 13 | let(:account_for_business) { api_instance.create_account( |
14 | 14 | data: { |
15 | 15 | type: 'depositAccount', |
16 | | - attributes: OpenapiClient::CreateDepositAccountAttributes.new( |
| 16 | + attributes: UnitOpenapiRubySdk::CreateDepositAccountAttributes.new( |
17 | 17 | deposit_product: 'checking', |
18 | 18 | tags: { "purpose": 'checking' }, |
19 | 19 | idempotency_key: '1234567890' |
20 | 20 | ).to_hash, relationships: RELATIONSHIPS_BUSINESS }).data.id} |
21 | 21 |
|
22 | 22 |
|
23 | 23 | it 'should create an individual debit card' do |
24 | | - request = { data: OpenapiClient::CreateIndividualDebitCardRequest.new(type: 'individualDebitCard', attributes: |
25 | | - OpenapiClient::CreateIndividualDebitCardRequestAttributes.new( |
| 24 | + request = { data: UnitOpenapiRubySdk::CreateIndividualDebitCardRequest.new(type: 'individualDebitCard', attributes: |
| 25 | + UnitOpenapiRubySdk::CreateIndividualDebitCardRequestAttributes.new( |
26 | 26 | { shipping_address: ADDRESS, tags: { "purpose": 'checking' }, |
27 | 27 | additional_embossed_text: 'additional_text', expiry_date: '03/28' } |
28 | 28 | ), |
29 | | - relationships: OpenapiClient::CardRelationships.new(account: { "data": { "type": 'depositAccount', |
| 29 | + relationships: UnitOpenapiRubySdk::CardRelationships.new(account: { "data": { "type": 'depositAccount', |
30 | 30 | "id": '4009403' } })).to_hash } |
31 | 31 | response = api_instance.create_card(request) |
32 | 32 | expect(response.data.type).to eq('individualDebitCard') |
33 | 33 | end |
34 | 34 |
|
35 | 35 | it 'should create a business debit card' do |
36 | | - request = { data: OpenapiClient::CreateBusinessDebitCardRequest.new(type: 'businessDebitCard', attributes: |
37 | | - OpenapiClient::CreateBusinessDebitCardRequestAttributes.new( |
| 36 | + request = { data: UnitOpenapiRubySdk::CreateBusinessDebitCardRequest.new(type: 'businessDebitCard', attributes: |
| 37 | + UnitOpenapiRubySdk::CreateBusinessCardAttributes.new( |
38 | 38 | { shipping_address: ADDRESS, address: ADDRESS, full_name: FULL_NAME, phone: PHONE, |
39 | 39 | email: EMAIL, date_of_birth: DATE_OF_BIRTH, nationality: 'US', ssn: SSN, |
40 | 40 | tags: { "purpose": 'business' }, limits: LIMITS, idempotency_key: '1234567890', |
41 | 41 | print_only_business_name: false, expiry_date: '03/28' } |
42 | 42 | ), |
43 | | - relationships: OpenapiClient::CardRelationships.new(account: { "data": { "type": 'account', |
| 43 | + relationships: UnitOpenapiRubySdk::CardRelationships.new(account: { "data": { "type": 'account', |
44 | 44 | "id": '3969030' } })).to_hash } |
45 | 45 | response = api_instance.create_card(request) |
46 | 46 | expect(response.data.type).to eq('businessDebitCard') |
|
0 commit comments