diff --git a/app/models/validators/range_overlapping_validator.rb b/app/models/validators/range_overlapping_validator.rb index 5be96df..cb15715 100644 --- a/app/models/validators/range_overlapping_validator.rb +++ b/app/models/validators/range_overlapping_validator.rb @@ -21,6 +21,7 @@ class RangeOverlappingValidator < ActiveModel::Validator def to_float(value) return 1.0/0 if value=="INF" return -1.0/0 if value=="-INF" + return value.to_f if value.is_a?(String) return value end end diff --git a/features/mezuro_range/create.feature b/features/mezuro_range/create.feature index 28914b6..5d2f1ea 100644 --- a/features/mezuro_range/create.feature +++ b/features/mezuro_range/create.feature @@ -158,4 +158,28 @@ Feature: Create range When I press the Save button Then I should be at metric configuration sample page And I should see "-INF" + And I should see "INF" + + @kalibro_restart @javascript + Scenario: Two valid ranges (one with INF) + Given I am a regular user + And I am signed in + And I own a sample configuration + And I own a sample reading group + And I have a sample metric configuration within the given mezuro configuration + And I have a sample reading within the sample reading group labeled "My Reading" + And I am at the New Range page + And I fill the Beginning field with "2" + And I fill the End field with "666" + And I fill the Comments field with "My Comment" + And I set the select field "Reading" as "My Reading" + And I press the Save button + And I am at the New Range page + And I fill the Beginning field with "666" + And I click the ∞ link + And I fill the Comments field with "My Comment" + And I set the select field "Reading" as "My Reading" + When I press the Save button + Then I should be at metric configuration sample page + And I should see "666" And I should see "INF" \ No newline at end of file -- libgit2 0.21.2