Commit 19c55b10cb03c01ab5cbf1060ee258b25e6e4121

Authored by Nathan Broadbent
1 parent 5f44b531
Exists in master and in 1 other branch production

Fixed Time rounding in specs to be compatible with both 1.8.7 and 1.9.2

Showing 1 changed file with 2 additions and 3 deletions   Show diff stats
spec/models/problem_spec.rb
... ... @@ -202,11 +202,10 @@ describe Problem do
202 202 end
203 203 end
204 204  
205   -
206 205 context "#last_deploy_at" do
207 206 before do
208 207 @app = Fabricate(:app)
209   - @last_deploy = 10.days.ago.localtime.round(0)
  208 + @last_deploy = Time.at(10.days.ago.localtime.to_i)
210 209 deploy = Fabricate(:deploy, :app => @app, :created_at => @last_deploy, :environment => "production")
211 210 end
212 211  
... ... @@ -217,7 +216,7 @@ describe Problem do
217 216  
218 217 it "is updated when a deploy is created" do
219 218 problem = Fabricate(:problem, :app => @app, :environment => "production")
220   - next_deploy = 5.minutes.ago.localtime.round(0)
  219 + next_deploy = Time.at(5.minutes.ago.localtime.to_i)
221 220 lambda {
222 221 @deploy = Fabricate(:deploy, :app => @app, :created_at => next_deploy)
223 222 problem.reload
... ...