Skip to content

Commit c28dd53

Browse files
authored
Merge pull request #32 from patch-technology/pc/17
Update types of cents_usd fields in responses
2 parents 7e9dfc0 + 2b2134d commit c28dd53

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.7.0] - 2021-07-14
9+
10+
### Changed
11+
12+
- [BREAKING] Changed `order.price_cents_usd` and `order.patch_fee_cents_usd` from string to integer.
13+
814
## [1.6.0] - 2021-07-14
915

1016
### Added

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
patch_ruby (1.5.2)
4+
patch_ruby (1.7.0)
55
json (~> 2.1, >= 2.1.0)
66
typhoeus (~> 1.0, >= 1.0.1)
77

@@ -19,11 +19,11 @@ GEM
1919
coderay (1.1.3)
2020
concurrent-ruby (1.1.7)
2121
diff-lcs (1.4.3)
22-
ethon (0.12.0)
23-
ffi (>= 1.3.0)
22+
ethon (0.14.0)
23+
ffi (>= 1.15.0)
2424
factory_bot (6.1.0)
2525
activesupport (>= 5.0.0)
26-
ffi (1.15.0)
26+
ffi (1.15.3)
2727
i18n (1.8.7)
2828
concurrent-ruby (~> 1.0)
2929
json (2.5.1)

lib/patch_ruby/models/order.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def self.openapi_types
9090
:'production' => :'Boolean',
9191
:'state' => :'String',
9292
:'allocation_state' => :'String',
93-
:'price_cents_usd' => :'String',
94-
:'patch_fee_cents_usd' => :'String',
93+
:'price_cents_usd' => :'Integer',
94+
:'patch_fee_cents_usd' => :'Integer',
9595
:'allocations' => :'Array<Allocation>',
9696
:'registry_url' => :'String',
9797
:'metadata' => :'Object'

lib/patch_ruby/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
=end
1212

1313
module Patch
14-
VERSION = '1.6.0'
14+
VERSION = '1.7.0'
1515
end

spec/integration/orders_spec.rb

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
expect(create_order_response.success).to eq true
4545
expect(order.id).not_to be_nil
4646
expect(order.mass_g).to eq(order_mass_g)
47-
expect(order.price_cents_usd.to_i).to be_between(expected_price - 2, expected_price + 2)
48-
expect(order.patch_fee_cents_usd).not_to be_empty
47+
expect(order.price_cents_usd).to be_between(expected_price - 2, expected_price + 2)
48+
expect(order.patch_fee_cents_usd).to be_kind_of(Integer)
4949
expect(order.registry_url).not_to be_empty
5050
end
5151

@@ -55,7 +55,7 @@
5555
)
5656

5757
project_id = retrieve_project_response.data.id
58-
total_price_cents_usd = 5_00
58+
total_price_cents_usd = 50_00
5959

6060
create_order_response = Patch::Order.create_order(
6161
total_price_cents_usd: total_price_cents_usd,
@@ -67,13 +67,7 @@
6767
order = create_order_response.data
6868

6969
expect(order.id).not_to be_nil
70-
expect(order.mass_g).to be > 450_000
71-
expect(order.mass_g).to be < 460_000
72-
expect(order.price_cents_usd).not_to be_empty
73-
expect(order.patch_fee_cents_usd).not_to be_empty
74-
expect(
75-
order.price_cents_usd.to_i + order.patch_fee_cents_usd.to_i
76-
).to eq(total_price_cents_usd)
70+
expect(order.price_cents_usd + order.patch_fee_cents_usd).to eq total_price_cents_usd
7771
expect(order.registry_url).not_to be_empty
7872
end
7973

0 commit comments

Comments
 (0)