From 129930b385e4eaea2da45c2ce9c393d035d288d6 Mon Sep 17 00:00:00 2001 From: Vokhmin Alexey V Date: Thu, 13 Dec 2012 23:28:50 +0400 Subject: [PATCH] hot fix for failed specs --- lib/modules/models/time_living.rb | 2 +- spec/factories/build_lists.rb | 1 + spec/factories/product_build_lists.rb | 2 +- spec/factories/products.rb | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/modules/models/time_living.rb b/lib/modules/models/time_living.rb index 68742b75f..81ec89dd3 100644 --- a/lib/modules/models/time_living.rb +++ b/lib/modules/models/time_living.rb @@ -12,7 +12,7 @@ module Modules validate lambda { # 2 min <= time_living <= 12 hours - if 120 > time_living || time_living > 43200 + if 120 > time_living.to_i || time_living.to_i > 43200 errors.add(:time_living, I18n.t('flash.time_living.numericality_error')) end } diff --git a/spec/factories/build_lists.rb b/spec/factories/build_lists.rb index 498e106f7..fc311d757 100644 --- a/spec/factories/build_lists.rb +++ b/spec/factories/build_lists.rb @@ -12,6 +12,7 @@ FactoryGirl.define do update_type 'security' include_repos {|bl| bl.save_to_platform.repositories.map(&:id)} project_version 'latest_master' + time_living 150 after(:build) {|bl| test_git_commit bl.project } end diff --git a/spec/factories/product_build_lists.rb b/spec/factories/product_build_lists.rb index 26cdd4f15..5b3ab66d6 100644 --- a/spec/factories/product_build_lists.rb +++ b/spec/factories/product_build_lists.rb @@ -7,7 +7,7 @@ FactoryGirl.define do status 0 # BUILD_COMPLETED main_script 'build.sh' params 'ENV=i586' - time_living 60 + time_living 150 project_version 'latest_master' end end diff --git a/spec/factories/products.rb b/spec/factories/products.rb index 47329965a..945539477 100644 --- a/spec/factories/products.rb +++ b/spec/factories/products.rb @@ -8,5 +8,6 @@ FactoryGirl.define do p.project.repo.index.add('test', 'TEST') p.project.repo.index.commit('Test commit') } + time_living 150 end end