spec/integration/estimates_spec.rb in patch_ruby-1.12.0 vs spec/integration/estimates_spec.rb in patch_ruby-1.13.0
- old
+ new
@@ -54,15 +54,16 @@
vehicle_estimate = Patch::Estimate.create_vehicle_estimate(
distance_m: distance_m,
make: make,
model: model,
year: year,
- create_order: false
+ create_order: true
)
expect(vehicle_estimate.data.type).to eq 'vehicle'
expect(vehicle_estimate.data.mass_g).to eq 5_500
+ expect(vehicle_estimate.data.order.mass_g).to eq 5_500
end
it 'supports creating vehicle estimates with partial information' do
distance_m = 10_000
@@ -89,11 +90,11 @@
expect(create_estimate_response.data.mass_g).to eq 12_431
end
it 'supports creating bitcoin estimates with partial information' do
- bitcoin_estimate = Patch::Estimate.create_bitcoin_estimate({})
+ bitcoin_estimate = Patch::Estimate.create_bitcoin_estimate()
expect(bitcoin_estimate.data.type).to eq 'bitcoin'
expect(bitcoin_estimate.data.mass_g).to be >= 2_000
end
@@ -119,9 +120,22 @@
timestamp: '2021-07-01T20:31:18.403Z'
)
expect(bitcoin_estimate_1.data.type).to eq 'bitcoin'
expect(bitcoin_estimate_1.data.mass_g).to be > bitcoin_estimate_2.data.mass_g # Bitcoin was emitting less in July 2021 than in June
+ end
+
+ it 'supports creating bitcoin estimates with a average_daily_balance_btc_sats' do
+ bitcoin_estimate_1 = Patch::Estimate.create_bitcoin_estimate(
+ average_daily_balance_btc_sats: 1000000
+ )
+
+ bitcoin_estimate_2 = Patch::Estimate.create_bitcoin_estimate(
+ average_daily_balance_btc_sats: 10000000
+ )
+
+ expect(bitcoin_estimate_1.data.type).to eq 'bitcoin'
+ expect(bitcoin_estimate_1.data.mass_g).to be < bitcoin_estimate_2.data.mass_g
end
it 'supports creating ethereum estimates with a gas amount' do
ethereum_estimate = Patch::Estimate.create_ethereum_estimate(
gas_used: 100