test(timespan): fix inconsistency between expectation and actual output
* Also added timecop to spec to avoid future breaks.
This commit is contained in:
parent
0a9b944526
commit
5fe98ab464
1 changed files with 3 additions and 1 deletions
|
@ -38,7 +38,9 @@ describe Timespan do
|
|||
|
||||
describe '#create' do
|
||||
it 'returns the correct number of seconds constituting a timespan' do
|
||||
expect(Timespan.create(1, 'month').to_i).to eq(2_592_000)
|
||||
Timecop.freeze(2018, 3, 25) do
|
||||
expect(Timespan.create(1, 'month').to_i).to eq(2_629_746)
|
||||
end
|
||||
end
|
||||
|
||||
it 'raises err when given an invalid time unit' do
|
||||
|
|
Loading…
Reference in a new issue