Commit 6eed6ac2b2d2b0faec48adc731b6f20ec9440680

Authored by Cyril Mougel
1 parent 38f427dc
Exists in master and in 1 other branch production

avoid some issue about date comparaison on test

spec/interactors/problem_updater_cache_spec.rb
... ... @@ -74,7 +74,7 @@ describe ProblemUpdaterCache do
74 74 end
75 75  
76 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 78 end
79 79  
80 80 it 'update last_notice_at' do
... ...
spec/models/problem_spec.rb
... ... @@ -57,10 +57,10 @@ describe Problem do
57 57 problem.should_not be_nil
58 58  
59 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 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 64 end
65 65 end
66 66  
... ...