From 19c55b10cb03c01ab5cbf1060ee258b25e6e4121 Mon Sep 17 00:00:00 2001 From: Nathan Broadbent Date: Thu, 1 Dec 2011 12:11:11 +0800 Subject: [PATCH] Fixed Time rounding in specs to be compatible with both 1.8.7 and 1.9.2 --- spec/models/problem_spec.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/spec/models/problem_spec.rb b/spec/models/problem_spec.rb index f78ccb8..155ef14 100644 --- a/spec/models/problem_spec.rb +++ b/spec/models/problem_spec.rb @@ -202,11 +202,10 @@ describe Problem do end end - context "#last_deploy_at" do before do @app = Fabricate(:app) - @last_deploy = 10.days.ago.localtime.round(0) + @last_deploy = Time.at(10.days.ago.localtime.to_i) deploy = Fabricate(:deploy, :app => @app, :created_at => @last_deploy, :environment => "production") end @@ -217,7 +216,7 @@ describe Problem do it "is updated when a deploy is created" do problem = Fabricate(:problem, :app => @app, :environment => "production") - next_deploy = 5.minutes.ago.localtime.round(0) + next_deploy = Time.at(5.minutes.ago.localtime.to_i) lambda { @deploy = Fabricate(:deploy, :app => @app, :created_at => next_deploy) problem.reload -- libgit2 0.21.2