Skip to content

Commit 180f6b7

Browse files
committed
Add spec for timestamp
1 parent 432cf71 commit 180f6b7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

Gemfile.lock

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

spec/integration/estimates_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@
100100
expect(bitcoin_estimate.data.mass_g).to be < bitcoin_estimate_2.data.mass_g
101101
end
102102

103+
it 'supports creating bitcoin estimates with a timestamp' do
104+
bitcoin_estimate_1 = Patch::Estimate.create_bitcoin_estimate(
105+
timestamp: '2021-06-01T20:31:18.403Z'
106+
)
107+
108+
bitcoin_estimate_2 = Patch::Estimate.create_bitcoin_estimate(
109+
timestamp: '2021-07-01T20:31:18.403Z'
110+
)
111+
112+
expect(bitcoin_estimate_1.data.type).to eq 'bitcoin'
113+
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
114+
end
115+
103116
it 'supports creating ethereum estimates with a gas amount' do
104117
ethereum_estimate = Patch::Estimate.create_ethereum_estimate(
105118
gas_used: 100

0 commit comments

Comments
 (0)