Add and apply Style/LineEndConcatenation rule
We were already using it in most places. Note that enabling this rule means we've got to change a few lines in order to follow the LineEndStringConcatenationIndentation rule. In the link list tests, the easiest way to do so was to use heredoc instead, which IMHO improves readability over the previous version.
This commit is contained in:
@@ -573,6 +573,9 @@ Style/IdenticalConditionalBranches:
|
||||
Style/IfWithBooleanLiteralBranches:
|
||||
Enabled: true
|
||||
|
||||
Style/LineEndConcatenation:
|
||||
Enabled: true
|
||||
|
||||
Style/MapToHash:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -18,9 +18,12 @@ describe Shared::LinkListComponent do
|
||||
["Home", "/"], ["Info", "/info"], class: "menu"
|
||||
)
|
||||
|
||||
expect(page).to be_rendered with: '<ul class="menu">' + "\n" +
|
||||
'<li><a href="/">Home</a></li>' + "\n" +
|
||||
'<li><a href="/info">Info</a></li>' + "\n</ul>\n"
|
||||
expect(page).to be_rendered with: <<~HTML
|
||||
<ul class="menu">
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/info">Info</a></li>
|
||||
</ul>
|
||||
HTML
|
||||
end
|
||||
|
||||
it "accepts anchor tags" do
|
||||
@@ -28,9 +31,12 @@ describe Shared::LinkListComponent do
|
||||
'<a href="/">Home</a>'.html_safe, ["Info", "/info"], class: "menu"
|
||||
)
|
||||
|
||||
expect(page).to be_rendered with: '<ul class="menu">' + "\n" +
|
||||
'<li><a href="/">Home</a></li>' + "\n" +
|
||||
'<li><a href="/info">Info</a></li>' + "\n</ul>\n"
|
||||
expect(page).to be_rendered with: <<~HTML
|
||||
<ul class="menu">
|
||||
<li><a href="/">Home</a></li>
|
||||
<li><a href="/info">Info</a></li>
|
||||
</ul>
|
||||
HTML
|
||||
end
|
||||
|
||||
it "accepts options for links" do
|
||||
|
||||
@@ -1797,8 +1797,8 @@ describe "Admin budget investments", :admin do
|
||||
columns_cookie = cookies.find { |cookie| cookie[:name] == "investments-columns" }
|
||||
cookie_value = columns_cookie[:value]
|
||||
|
||||
expect(cookie_value).to eq("id,title,supports,admin,valuator,geozone," +
|
||||
"feasibility,price,valuation_finished,visible_to_valuators,selected,incompatible")
|
||||
expect(cookie_value).to eq("id,title,supports,admin,valuator,geozone,feasibility,price," \
|
||||
"valuation_finished,visible_to_valuators,selected,incompatible")
|
||||
end
|
||||
|
||||
scenario "Use column selector to display visible columns" do
|
||||
@@ -1847,8 +1847,8 @@ describe "Admin budget investments", :admin do
|
||||
columns_cookie = cookies.find { |cookie| cookie[:name] == "investments-columns" }
|
||||
cookie_value = columns_cookie[:value]
|
||||
|
||||
expect(cookie_value).to eq("id,supports,admin,geozone," +
|
||||
"feasibility,valuation_finished,visible_to_valuators,selected,incompatible,author")
|
||||
expect(cookie_value).to eq("id,supports,admin,geozone,feasibility,valuation_finished," \
|
||||
"visible_to_valuators,selected,incompatible,author")
|
||||
|
||||
visit admin_budget_budget_investments_path(budget)
|
||||
|
||||
@@ -1856,8 +1856,8 @@ describe "Admin budget investments", :admin do
|
||||
columns_cookie = cookies.find { |cookie| cookie[:name] == "investments-columns" }
|
||||
cookie_value = columns_cookie[:value]
|
||||
|
||||
expect(cookie_value).to eq("id,supports,admin,geozone,feasibility,valuation_finished," +
|
||||
"visible_to_valuators,selected,incompatible,author")
|
||||
expect(cookie_value).to eq("id,supports,admin,geozone,feasibility,valuation_finished," \
|
||||
"visible_to_valuators,selected,incompatible,author")
|
||||
end
|
||||
|
||||
scenario "Select an investment when some columns are not displayed" do
|
||||
|
||||
Reference in New Issue
Block a user