Skip to content

Commit

Permalink
seemingly harmless change
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-bites committed Jul 18, 2023
1 parent eb9db11 commit 2b77027
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 72 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
trolley (1.0.0)
trolley (1.0.3)

GEM
remote: https://rubygems.org/
Expand Down
136 changes: 69 additions & 67 deletions spec/integration/PaymentTest.rb
Original file line number Diff line number Diff line change
@@ -1,67 +1,69 @@
require_relative 'helper'

class PaymentTest < Test::Unit::TestCase
include ApiClientHelper

def recipient
uuid = SecureRandom.uuid.to_s
recipient = @client.recipient.create(
type: 'individual',
firstName: 'Tom',
lastName: 'Jones',
email: "test.batch#{uuid}@example.com",
address: {
street1: '123 Wolfstrasse',
city: 'Berlin',
country: 'DE',
postalCode: '123123'
}
)
@client.recipient_account.create(recipient.id, type: 'bank-transfer', currency: 'EUR', country: 'DE', iban: 'DE89 3704 0044 0532 0130 00')
recipient
end
def batch
@_batch ||= @client.batch.create(sourceCurrency: 'USD', description: 'Integration Test Create')
end
def test_crud
payment = @client.payment.create(
batch.id,
sourceAmount: '10.00',
sourceCurrency: 'USD',
recipient: { id: recipient.id }
)

assert_not_nil(payment)
assert_not_nil(payment.id)
assert_equal('10.00', payment.sourceAmount)
assert_equal('USD', payment.sourceCurrency)

payment = @client.payment.find(batch.id, payment.id)
assert_not_nil(payment)

update_response = @client.payment.update(
batch.id,
payment.id,
sourceAmount: '20.00',
sourceCurrency: 'USD'
)

assert_not_nil(update_response)

response = @client.payment.delete(batch.id, payment.id)
assert_true(response)
end

def test_search
@client.payment.create(
batch.id,
sourceAmount: '10.00',
sourceCurrency: 'USD',
recipient: { id: recipient.id }
)

result =@client.payment.search(batch.id)
assert_not_nil(result)
assert_true(result.count > 0)
end
end
require_relative 'helper'

class PaymentTest < Test::Unit::TestCase
include ApiClientHelper

def recipient
uuid = SecureRandom.uuid.to_s
recipient = @client.recipient.create(
type: 'individual',
firstName: 'Tom',
lastName: 'Jones',
email: "test.batch#{uuid}@example.com",
address: {
street1: '123 Wolfstrasse',
city: 'Berlin',
country: 'DE',
postalCode: '123123'
}
)
@client.recipient_account.create(recipient.id, type: 'bank-transfer', currency: 'EUR', country: 'DE', iban: 'DE89 3704 0044 0532 0130 00')
recipient
end

def batch
@_batch ||= @client.batch.create(sourceCurrency: 'USD', description: 'Integration Test Create')
end

def test_crud
payment = @client.payment.create(
batch.id,
sourceAmount: '10.00',
sourceCurrency: 'USD',
recipient: { id: recipient.id }
)

assert_not_nil(payment)
assert_not_nil(payment.id)
assert_equal('10.00', payment.sourceAmount)
assert_equal('USD', payment.sourceCurrency)

payment = @client.payment.find(batch.id, payment.id)
assert_not_nil(payment)

update_response = @client.payment.update(
batch.id,
payment.id,
sourceAmount: '20.00',
sourceCurrency: 'USD'
)

assert_not_nil(update_response)

response = @client.payment.delete(batch.id, payment.id)
assert_true(response)
end

def test_search
@client.payment.create(
batch.id,
sourceAmount: '10.00',
sourceCurrency: 'USD',
recipient: { id: recipient.id }
)

result = @client.payment.search(batch.id)
assert_not_nil(result)
assert_true(result.count > 0)
end
end
8 changes: 4 additions & 4 deletions trolley.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Gem::Specification.new do |s|
s.add_development_dependency 'rubocop', '~> 1'
s.add_development_dependency 'test-unit', '~> 3'
s.metadata = {
"bug_tracker_uri" => "https://github.com/trolley/ruby-sdk/issues",
"changelog_uri" => "https://github.com/trolley/ruby-sdk/releases",
"bug_tracker_uri" => "https://github.com/trolley/ruby-sdk/issues",
"changelog_uri" => "https://github.com/trolley/ruby-sdk/releases",
"documentation_uri" => "https://docs.trolley.com",
"homepage_uri" => "https://github.com/trolley/ruby-sdk/",
"source_code_uri" => "https://github.com/trolley/ruby-sdk.git",
"homepage_uri" => "https://github.com/trolley/ruby-sdk/",
"source_code_uri" => "https://github.com/trolley/ruby-sdk.git"
}
end

0 comments on commit 2b77027

Please sign in to comment.