summaryrefslogtreecommitdiff
path: root/spec/rubocop/cop/qa
diff options
context:
space:
mode:
authorddavison <ddavison@gitlab.com>2019-07-09 14:44:16 -0700
committerddavison <ddavison@gitlab.com>2019-07-10 16:10:28 -0700
commit015b61b1dc73e2c8d6e6cf04b6b2c7fb896a452f (patch)
tree218b05eb1f0500c01a0b6e7dccd3a2ea433df73b /spec/rubocop/cop/qa
parent98fc3f23db648a16096994ba3b70d461b5b1ccf0 (diff)
downloadgitlab-ce-015b61b1dc73e2c8d6e6cf04b6b2c7fb896a452f.tar.gz
Change element_with_pattern cop to not use quotes
Using quotes within string validations can be messy. Let's use a typical CSS selector for an unquoted attribute Update the cop spec to validate appropriate new message
Diffstat (limited to 'spec/rubocop/cop/qa')
-rw-r--r--spec/rubocop/cop/qa/element_with_pattern_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/rubocop/cop/qa/element_with_pattern_spec.rb b/spec/rubocop/cop/qa/element_with_pattern_spec.rb
index ef20d9a1f26..fee390caa9f 100644
--- a/spec/rubocop/cop/qa/element_with_pattern_spec.rb
+++ b/spec/rubocop/cop/qa/element_with_pattern_spec.rb
@@ -23,9 +23,9 @@ describe RuboCop::Cop::QA::ElementWithPattern do
expect_offense(<<-RUBY)
view 'app/views/shared/groups/_search_form.html.haml' do
element :groups_filter, 'search_field_tag :filter'
- ^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use a pattern for element, create a corresponding `qa-groups-filter` instead.
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Don't use a pattern for element, create a corresponding `data-qa-selector=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 `data-qa-selector=groups_filter_placeholder` instead.
end
RUBY
end