diff options
author | ddavison <ddavison@gitlab.com> | 2019-03-01 18:03:43 -0800 |
---|---|---|
committer | ddavison <ddavison@gitlab.com> | 2019-05-20 12:35:51 -0700 |
commit | 7d5b68d837545909204e6caf2352f34ac2f1ba7a (patch) | |
tree | 2c646c34cfdb635ff671647562a480af247f5bbb /spec/rubocop | |
parent | 4063b7e811050c0870d782072664673e16eafdfe (diff) | |
download | gitlab-ce-7d5b68d837545909204e6caf2352f34ac2f1ba7a.tar.gz |
Implement dynamic validation on QA Pages
Elements now have the ability to be required on pages or not
Currently using the default wait mechanism
Altered the ElementWithPattern Cop to fit new splat for init
Diffstat (limited to 'spec/rubocop')
-rw-r--r-- | spec/rubocop/cop/qa/element_with_pattern_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/rubocop/cop/qa/element_with_pattern_spec.rb b/spec/rubocop/cop/qa/element_with_pattern_spec.rb index c5beb40f9fd..ef20d9a1f26 100644 --- a/spec/rubocop/cop/qa/element_with_pattern_spec.rb +++ b/spec/rubocop/cop/qa/element_with_pattern_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'rubocop' @@ -23,7 +25,7 @@ describe RuboCop::Cop::QA::ElementWithPattern do element :groups_filter, 'search_field_tag :filter' ^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use a pattern for element, create a corresponding `qa-groups-filter` instead. element :groups_filter_placeholder, /Search by name/ - ^^^^^^^^^^^^^^^^ Don't use a pattern for element, create a corresponding `qa-groups-filter-placeholder` instead. + ^^^^^^^^^^^^^^ Don't use a pattern for element, create a corresponding `qa-groups-filter-placeholder` instead. end RUBY end @@ -35,6 +37,13 @@ describe RuboCop::Cop::QA::ElementWithPattern do element :groups_filter_placeholder end RUBY + + expect_no_offenses(<<-RUBY) + view 'app/views/shared/groups/_search_form.html.haml' do + element :groups_filter, required: true + element :groups_filter_placeholder, required: false + end + RUBY end end |