#778: update TimeLiving class

This commit is contained in:
Vokhmin Alexey V 2012-12-13 23:23:34 +04:00
parent 7528b05715
commit c08d99ffbb
2 changed files with 3 additions and 3 deletions

View File

@ -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
}

View File

@ -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