Add and apply AmbiguousRegexpLiteral rule
This is a very subtle behaviour: `match /attachment/i` could represent a regular expression, but it could also represent a division like `match / attachment / i`. So we need to make an exception to the usual way we omit parenthesis in RSpec expectations.
This commit is contained in:
@@ -117,6 +117,9 @@ Layout/TrailingBlankLines:
|
||||
Layout/TrailingWhitespace:
|
||||
Enabled: true
|
||||
|
||||
Lint/AmbiguousRegexpLiteral:
|
||||
Enabled: true
|
||||
|
||||
Lint/LiteralAsCondition:
|
||||
Enabled: true
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ describe "Admin download user emails" do
|
||||
end
|
||||
|
||||
header = page.response_headers["Content-Disposition"]
|
||||
expect(header).to match /^attachment/
|
||||
expect(header).to match /filename="Administrators.csv"$/
|
||||
expect(header).to match(/^attachment/)
|
||||
expect(header).to match(/filename="Administrators.csv"$/)
|
||||
|
||||
file_contents = page.body.split(",")
|
||||
expect(file_contents).to match_array ["admin_news1@consul.dev", "admin_news2@consul.dev"]
|
||||
|
||||
Reference in New Issue
Block a user