Skip to content

Commit

Permalink
Merge pull request #32 from patch-technology/pc/17
Browse files Browse the repository at this point in the history
Update types of cents_usd fields in responses
  • Loading branch information
pcothenet authored Jul 14, 2021
2 parents 7e9dfc0 + 2b2134d commit c28dd53
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.7.0] - 2021-07-14

### Changed

- [BREAKING] Changed `order.price_cents_usd` and `order.patch_fee_cents_usd` from string to integer.

## [1.6.0] - 2021-07-14

### Added
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
patch_ruby (1.5.2)
patch_ruby (1.7.0)
json (~> 2.1, >= 2.1.0)
typhoeus (~> 1.0, >= 1.0.1)

Expand All @@ -19,11 +19,11 @@ GEM
coderay (1.1.3)
concurrent-ruby (1.1.7)
diff-lcs (1.4.3)
ethon (0.12.0)
ffi (>= 1.3.0)
ethon (0.14.0)
ffi (>= 1.15.0)
factory_bot (6.1.0)
activesupport (>= 5.0.0)
ffi (1.15.0)
ffi (1.15.3)
i18n (1.8.7)
concurrent-ruby (~> 1.0)
json (2.5.1)
Expand Down
4 changes: 2 additions & 2 deletions lib/patch_ruby/models/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def self.openapi_types
:'production' => :'Boolean',
:'state' => :'String',
:'allocation_state' => :'String',
:'price_cents_usd' => :'String',
:'patch_fee_cents_usd' => :'String',
:'price_cents_usd' => :'Integer',
:'patch_fee_cents_usd' => :'Integer',
:'allocations' => :'Array<Allocation>',
:'registry_url' => :'String',
:'metadata' => :'Object'
Expand Down
2 changes: 1 addition & 1 deletion lib/patch_ruby/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
=end

module Patch
VERSION = '1.6.0'
VERSION = '1.7.0'
end
14 changes: 4 additions & 10 deletions spec/integration/orders_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
expect(create_order_response.success).to eq true
expect(order.id).not_to be_nil
expect(order.mass_g).to eq(order_mass_g)
expect(order.price_cents_usd.to_i).to be_between(expected_price - 2, expected_price + 2)
expect(order.patch_fee_cents_usd).not_to be_empty
expect(order.price_cents_usd).to be_between(expected_price - 2, expected_price + 2)
expect(order.patch_fee_cents_usd).to be_kind_of(Integer)
expect(order.registry_url).not_to be_empty
end

Expand All @@ -55,7 +55,7 @@
)

project_id = retrieve_project_response.data.id
total_price_cents_usd = 5_00
total_price_cents_usd = 50_00

create_order_response = Patch::Order.create_order(
total_price_cents_usd: total_price_cents_usd,
Expand All @@ -67,13 +67,7 @@
order = create_order_response.data

expect(order.id).not_to be_nil
expect(order.mass_g).to be > 450_000
expect(order.mass_g).to be < 460_000
expect(order.price_cents_usd).not_to be_empty
expect(order.patch_fee_cents_usd).not_to be_empty
expect(
order.price_cents_usd.to_i + order.patch_fee_cents_usd.to_i
).to eq(total_price_cents_usd)
expect(order.price_cents_usd + order.patch_fee_cents_usd).to eq total_price_cents_usd
expect(order.registry_url).not_to be_empty
end

Expand Down

0 comments on commit c28dd53

Please sign in to comment.