Apply Style/StringLiteralsInInterpolation rubocop rule

We were already using it in most places.
This commit is contained in:
Javi Martín
2019-10-26 13:37:36 +02:00
parent 8e3bfa0d72
commit 34e66acdda
5 changed files with 10 additions and 7 deletions

View File

@@ -417,3 +417,6 @@ Style/SafeNavigation:
Style/StringLiterals: Style/StringLiterals:
EnforcedStyle: double_quotes EnforcedStyle: double_quotes
Style/StringLiteralsInInterpolation:
EnforcedStyle: double_quotes

View File

@@ -59,7 +59,7 @@ section "Creating Poll Questions & Answers" do
end end
question.save! question.save!
Faker::Lorem.words((2..4).to_a.sample).each_with_index do |title, index| Faker::Lorem.words((2..4).to_a.sample).each_with_index do |title, index|
description = "<p>#{Faker::Lorem.paragraphs.join('</p><p>')}</p>" description = "<p>#{Faker::Lorem.paragraphs.join("</p><p>")}</p>"
answer = Poll::Question::Answer.new(question: question, answer = Poll::Question::Answer.new(question: question,
title: title.capitalize, title: title.capitalize,
description: description, description: description,

View File

@@ -194,13 +194,13 @@ describe "Admin booths assignments" do
end end
within("#recounts_list") do within("#recounts_list") do
within("#recounting_#{poll.starts_at.to_date.strftime('%Y%m%d')}") do within("#recounting_#{poll.starts_at.to_date.strftime("%Y%m%d")}") do
expect(page).to have_content 1 expect(page).to have_content 1
end end
within("#recounting_#{(poll.ends_at.to_date - 5.days).strftime('%Y%m%d')}") do within("#recounting_#{(poll.ends_at.to_date - 5.days).strftime("%Y%m%d")}") do
expect(page).to have_content "-" expect(page).to have_content "-"
end end
within("#recounting_#{poll.ends_at.to_date.strftime('%Y%m%d')}") do within("#recounting_#{poll.ends_at.to_date.strftime("%Y%m%d")}") do
expect(page).to have_content 1 expect(page).to have_content 1
end end
end end

View File

@@ -197,9 +197,9 @@ describe Dashboard::Mailer do
"among other features and rewards that you will discover. "\ "among other features and rewards that you will discover. "\
"Dont stop adding support and we will not stop rewarding "\ "Dont stop adding support and we will not stop rewarding "\
"and helping you!") "and helping you!")
expect(email).to have_body_text("You have #{Setting['months_to_archive_proposals']} months "\ expect(email).to have_body_text("You have #{Setting["months_to_archive_proposals"]} months "\
"since you publish the proposal to get "\ "since you publish the proposal to get "\
"#{Setting['votes_for_proposal_success']} support and your "\ "#{Setting["votes_for_proposal_success"]} support and your "\
"proposal can become a reality. But the first days are the "\ "proposal can become a reality. But the first days are the "\
"most important. It is a challenge. Get ready!") "most important. It is a challenge. Get ready!")
expect(email).to have_body_text("And for you to start with all the motivation,") expect(email).to have_body_text("And for you to start with all the motivation,")

View File

@@ -128,7 +128,7 @@ describe Proposal do
it "has a code" do it "has a code" do
Setting["proposal_code_prefix"] = "TEST" Setting["proposal_code_prefix"] = "TEST"
proposal = create(:proposal) proposal = create(:proposal)
expect(proposal.code).to eq "TEST-#{proposal.created_at.strftime('%Y-%m')}-#{proposal.id}" expect(proposal.code).to eq "TEST-#{proposal.created_at.strftime("%Y-%m")}-#{proposal.id}"
Setting["proposal_code_prefix"] = "MAD" Setting["proposal_code_prefix"] = "MAD"
end end