Add and apply Style/RedundantStringEscape rule

This rule was added in rubocop 1.37.0. It's particularly useful in the
background image spec, since now there's one less backslash to decipher
when reading the code :).
This commit is contained in:
Javi Martín
2023-09-04 18:22:58 +02:00
parent ff04009e4a
commit daa35845da
3 changed files with 6 additions and 3 deletions

View File

@@ -691,6 +691,9 @@ Style/RedundantReturn:
Style/RedundantSelf: Style/RedundantSelf:
Enabled: true Enabled: true
Style/RedundantStringEscape:
Enabled: true
Style/SafeNavigation: Style/SafeNavigation:
Enabled: true Enabled: true

View File

@@ -73,7 +73,7 @@ describe Budgets::BudgetComponent do
expect(page).to have_css ".budget-header.with-background-image" expect(page).to have_css ".budget-header.with-background-image"
expect(page).to have_css ".budget-header[style*='background-image:']" \ expect(page).to have_css ".budget-header[style*='background-image:']" \
"[style*='url(\\''][style*='clippy_with_\\\\\'quotes\\\\\'.jpg']" "[style*='url(\\''][style*='clippy_with_\\\\'quotes\\\\'.jpg']"
end end
end end
end end

View File

@@ -325,8 +325,8 @@ describe "Proposals" do
proposal = create(:proposal) proposal = create(:proposal)
visit proposal_path(proposal) visit proposal_path(proposal)
expect(page).to have_css "meta[name='twitter:title'][content=\'#{proposal.title}\']", visible: :hidden expect(page).to have_css "meta[name='twitter:title'][content='#{proposal.title}']", visible: :hidden
expect(page).to have_css "meta[property='og:title'][content=\'#{proposal.title}\']", visible: :hidden expect(page).to have_css "meta[property='og:title'][content='#{proposal.title}']", visible: :hidden
end end
scenario "Create and publish", :with_frozen_time do scenario "Create and publish", :with_frozen_time do