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/models/product_spec.rb b/spec/models/product_spec.rb index d8068fae6..64af554c3 100644 --- a/spec/models/product_spec.rb +++ b/spec/models/product_spec.rb @@ -7,7 +7,7 @@ describe Product do Platform.delete_all User.delete_all Product.delete_all - FileUtils.rm_rf(APP_CONFIG['root_path']) + init_test_root # Need for validate_uniqueness_of check FactoryGirl.create(:product) end @@ -28,7 +28,7 @@ describe Product do Platform.delete_all User.delete_all Product.delete_all - FileUtils.rm_rf(APP_CONFIG['root_path']) + clear_test_root end end