diff options
| author | Zog | 2018-03-29 10:02:28 +0200 | 
|---|---|---|
| committer | Zog | 2018-03-29 10:02:28 +0200 | 
| commit | 0b9d39df0ba1b3882edf0b50697f004bb402e820 (patch) | |
| tree | fb576d436103c66e6ceef8ded897df6556fdb98b /spec/support | |
| parent | 8c9ab7cb67772fb8642aae56b96fb325fd18ae04 (diff) | |
| download | chouette-core-0b9d39df0ba1b3882edf0b50697f004bb402e820.tar.bz2 | |
Fix MinMax Validation
Diffstat (limited to 'spec/support')
| -rw-r--r-- | spec/support/shared_examples/compliance_control_validation.rb | 18 | 
1 files changed, 18 insertions, 0 deletions
| diff --git a/spec/support/shared_examples/compliance_control_validation.rb b/spec/support/shared_examples/compliance_control_validation.rb index b23c2984f..3a8232193 100644 --- a/spec/support/shared_examples/compliance_control_validation.rb +++ b/spec/support/shared_examples/compliance_control_validation.rb @@ -12,7 +12,25 @@ RSpec.shared_examples_for 'has min_max_values' do      end    end +  context "is valid" do +    it 'if minimum is well formatted' do +      subject.minimum = "12" +      expect_it.to be_valid +      subject.minimum = "12.0" +      expect_it.to be_valid +      subject.minimum = "12.01" +      expect_it.to be_valid +    end +  end +    context "is invalid" do +    it 'if minimum is not well formatted' do +      subject.minimum = "AA" +      expect_it.not_to be_valid +      subject.minimum = "12." +      expect_it.not_to be_valid +    end +      it 'if no value is provided' do        subject.minimum = nil        subject.maximum = nil | 
