diff options
| author | Alban Peignier | 2018-01-10 09:37:33 +0100 | 
|---|---|---|
| committer | Alban Peignier | 2018-01-10 09:37:33 +0100 | 
| commit | 23d91f87304af8c9e94fc75ce42fe2195aa0fc59 (patch) | |
| tree | 65833e86a91c20001d3a5f2fe3e92ab3f57846a1 /spec/models | |
| parent | 2fa6e52c311a0ca63d6bb6339bb056ee0dad5b8c (diff) | |
| download | chouette-core-23d91f87304af8c9e94fc75ce42fe2195aa0fc59.tar.bz2 | |
Use AreaType.label in StopArea parent type validation message. Refs #5515
Diffstat (limited to 'spec/models')
| -rw-r--r-- | spec/models/chouette/stop_area_spec.rb | 9 | 
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/chouette/stop_area_spec.rb b/spec/models/chouette/stop_area_spec.rb index 9db0f11a5..a90e5d816 100644 --- a/spec/models/chouette/stop_area_spec.rb +++ b/spec/models/chouette/stop_area_spec.rb @@ -1,3 +1,4 @@ +# coding: utf-8  require 'spec_helper'  describe Chouette::StopArea, :type => :model do @@ -460,6 +461,14 @@ describe Chouette::StopArea, :type => :model do        expect(stop_area.errors).to have_key(:parent_id)      end +    it "use parent area type label in validation error message" do +      stop_area.area_type = 'zdep' +      stop_area.parent.area_type = 'zdep' + +      stop_area.valid? +      expect(stop_area.errors[:parent_id].first).to include(Chouette::AreaType.find(stop_area.parent.area_type).label) +    end +    end    describe '#waiting_time' do  | 
