diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/features/safe_submit_spec.rb | 9 | ||||
| -rw-r--r-- | spec/models/chouette/stop_area_spec.rb | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/spec/features/safe_submit_spec.rb b/spec/features/safe_submit_spec.rb new file mode 100644 index 000000000..9968d4310 --- /dev/null +++ b/spec/features/safe_submit_spec.rb @@ -0,0 +1,9 @@ +RSpec.describe 'SafeSubmit', type: :feature do + login_user + + let( :path ){ new_api_key_path() } + it 'view shows the corresponding buttons' do + visit path + expect(page).to have_css('input[type=submit][data-disable-with]') + end +end 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 |
