Commit 7cd5df5c43a6e668848ca8eafa022a181c842e52

Authored by Laust Rud Jacobsen
1 parent f9172d55
Exists in master and in 1 other branch production

Rubocop: expanding a regexp perl backref

.rubocop_todo.yml
@@ -207,12 +207,6 @@ Style/PercentLiteralDelimiters: @@ -207,12 +207,6 @@ Style/PercentLiteralDelimiters:
207 - 'app/controllers/problems_searcher.rb' 207 - 'app/controllers/problems_searcher.rb'
208 - 'spec/models/notice_spec.rb' 208 - 'spec/models/notice_spec.rb'
209 209
210 -# Offense count: 1  
211 -# Cop supports --auto-correct.  
212 -Style/PerlBackrefs:  
213 - Exclude:  
214 - - 'spec/acceptance/reset_password_token.rb'  
215 -  
216 # Offense count: 3 210 # Offense count: 3
217 # Cop supports --auto-correct. 211 # Cop supports --auto-correct.
218 Style/Proc: 212 Style/Proc:
spec/acceptance/reset_password_token.rb
@@ -20,7 +20,7 @@ feature 'password reset token' do @@ -20,7 +20,7 @@ feature 'password reset token' do
20 expect(mail.body.encoded).to match(/change your password/) 20 expect(mail.body.encoded).to match(/change your password/)
21 expect(mail.body.encoded).to match(regex) 21 expect(mail.body.encoded).to match(regex)
22 if mail.body.encoded =~ regex 22 if mail.body.encoded =~ regex
23 - visit "/users/password/edit?reset_password_token=#{$1}" 23 + visit "/users/password/edit?reset_password_token=#{Regexp.last_match(1)}"
24 expect(page).to have_content 'Change your password' 24 expect(page).to have_content 'Change your password'
25 fill_in 'New password', with: 'test12345' 25 fill_in 'New password', with: 'test12345'
26 fill_in 'Type your new password again', with: 'test12345' 26 fill_in 'Type your new password again', with: 'test12345'