Fix rubocop offenses - Requires Ruby 3.1+

This commit is contained in:
Sebastian Serth
2022-11-25 10:53:14 +01:00
parent bdf474e684
commit 574e99eddd
93 changed files with 315 additions and 315 deletions

View File

@ -34,7 +34,7 @@ describe 'Authentication' do
end
context 'with no authentication token' do
let(:request_for_comment) { create(:rfc_with_comment, user: user) }
let(:request_for_comment) { create(:rfc_with_comment, user:) }
let(:rfc_path) { request_for_comment_url(request_for_comment) }
it 'denies access to the request for comment' do
@ -49,7 +49,7 @@ describe 'Authentication' do
context 'with an authentication token' do
let(:user) { create(:learner) }
let(:study_group) { request_for_comment.submission.study_group }
let(:request_for_comment) { create(:rfc_with_comment, user: user) }
let(:request_for_comment) { create(:rfc_with_comment, user:) }
let(:commenting_user) { InternalUser.create(attributes_for(:teacher)) }
let(:mail) { UserMailer.got_new_comment(request_for_comment.comments.first, request_for_comment, commenting_user) }
let(:rfc_link) { request_for_comment_url(request_for_comment, token: token.shared_secret) }
@ -57,7 +57,7 @@ describe 'Authentication' do
before { allow(AuthenticationToken).to receive(:generate!).with(user, study_group).and_return(token).once }
context 'when the token is valid' do
let(:token) { create(:authentication_token, user: user, study_group: study_group) }
let(:token) { create(:authentication_token, user:, study_group:) }
it 'allows access to the request for comment' do
mail.deliver_now
@ -68,7 +68,7 @@ describe 'Authentication' do
end
context 'with an expired authentication token' do
let(:token) { create(:authentication_token, :invalid, user: user, study_group: study_group) }
let(:token) { create(:authentication_token, :invalid, user:, study_group:) }
it 'denies access to the request for comment' do
mail.deliver_now
@ -81,7 +81,7 @@ describe 'Authentication' do
end
context 'when the authentication token is used to login' do
let(:token) { create(:authentication_token, user: user, study_group: study_group) }
let(:token) { create(:authentication_token, user:, study_group:) }
it 'invalidates the token on login' do
mail.deliver_now
@ -108,14 +108,14 @@ describe 'Authentication' do
end
context 'with an authentication token' do
let(:request_for_comment) { create(:rfc_with_comment, user: user) }
let(:request_for_comment) { create(:rfc_with_comment, user:) }
let(:study_group) { request_for_comment.submission.study_group }
let(:commenting_user) { InternalUser.create(attributes_for(:teacher)) }
let(:mail) { UserMailer.got_new_comment(request_for_comment.comments.first, request_for_comment, commenting_user) }
let(:rfc_link) { request_for_comment_url(request_for_comment, token: token.shared_secret) }
it 'still invalidates the token on login' do
token = create(:authentication_token, user: user, study_group: study_group)
token = create(:authentication_token, user:, study_group:)
mail = UserMailer.got_new_comment(request_for_comment.comments.first, request_for_comment, commenting_user)
mail.deliver_now
visit(request_for_comment_url(request_for_comment, token: token.shared_secret))