From 6eed6ac2b2d2b0faec48adc731b6f20ec9440680 Mon Sep 17 00:00:00 2001 From: Cyril Mougel Date: Mon, 27 May 2013 11:15:14 +0200 Subject: [PATCH] avoid some issue about date comparaison on test --- spec/interactors/problem_updater_cache_spec.rb | 2 +- spec/models/problem_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/interactors/problem_updater_cache_spec.rb b/spec/interactors/problem_updater_cache_spec.rb index ff6f743..5a7a66f 100644 --- a/spec/interactors/problem_updater_cache_spec.rb +++ b/spec/interactors/problem_updater_cache_spec.rb @@ -74,7 +74,7 @@ describe ProblemUpdaterCache do end it 'update first_notice_at' do - expect(problem.first_notice_at.to_time).to eq notice.created_at.to_time + expect(problem.first_notice_at.to_i).to be_within(1).of(notice.created_at.to_i) end it 'update last_notice_at' do diff --git a/spec/models/problem_spec.rb b/spec/models/problem_spec.rb index a39a64f..71005a2 100644 --- a/spec/models/problem_spec.rb +++ b/spec/models/problem_spec.rb @@ -57,10 +57,10 @@ describe Problem do problem.should_not be_nil notice1 = Fabricate(:notice, :err => err) - problem.first_notice_at.should == notice1.created_at + expect(problem.first_notice_at.to_i).to be_within(1).of(notice.created_at.to_i) notice2 = Fabricate(:notice, :err => err) - problem.first_notice_at.to_time.should eq notice1.created_at + expect(problem.first_notice_at.to_i).to be_within(1).of(notice.created_at.to_i) end end -- libgit2 0.21.2