Commit 6eed6ac2b2d2b0faec48adc731b6f20ec9440680
1 parent
38f427dc
Exists in
master
and in
1 other branch
avoid some issue about date comparaison on test
Showing
2 changed files
with
3 additions
and
3 deletions
Show diff stats
spec/interactors/problem_updater_cache_spec.rb
@@ -74,7 +74,7 @@ describe ProblemUpdaterCache do | @@ -74,7 +74,7 @@ describe ProblemUpdaterCache do | ||
74 | end | 74 | end |
75 | 75 | ||
76 | it 'update first_notice_at' do | 76 | it 'update first_notice_at' do |
77 | - expect(problem.first_notice_at.to_time).to eq notice.created_at.to_time | 77 | + expect(problem.first_notice_at.to_i).to be_within(1).of(notice.created_at.to_i) |
78 | end | 78 | end |
79 | 79 | ||
80 | it 'update last_notice_at' do | 80 | it 'update last_notice_at' do |
spec/models/problem_spec.rb
@@ -57,10 +57,10 @@ describe Problem do | @@ -57,10 +57,10 @@ describe Problem do | ||
57 | problem.should_not be_nil | 57 | problem.should_not be_nil |
58 | 58 | ||
59 | notice1 = Fabricate(:notice, :err => err) | 59 | notice1 = Fabricate(:notice, :err => err) |
60 | - problem.first_notice_at.should == notice1.created_at | 60 | + expect(problem.first_notice_at.to_i).to be_within(1).of(notice.created_at.to_i) |
61 | 61 | ||
62 | notice2 = Fabricate(:notice, :err => err) | 62 | notice2 = Fabricate(:notice, :err => err) |
63 | - problem.first_notice_at.to_time.should eq notice1.created_at | 63 | + expect(problem.first_notice_at.to_i).to be_within(1).of(notice.created_at.to_i) |
64 | end | 64 | end |
65 | end | 65 | end |
66 | 66 |