Autofix Rubocop Style/StringLiterals (#23695)
This commit is contained in:
parent
ac3561098e
commit
81ad6c2e39
76 changed files with 277 additions and 359 deletions
|
@ -32,7 +32,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
|||
|
||||
describe 'GET #edit' do
|
||||
it 'returns http success' do
|
||||
request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
request.env['devise.mapping'] = Devise.mappings[:user]
|
||||
sign_in(Fabricate(:user))
|
||||
get :edit
|
||||
expect(response).to have_http_status(200)
|
||||
|
@ -41,7 +41,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
|||
|
||||
describe 'GET #update' do
|
||||
it 'returns http success' do
|
||||
request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
request.env['devise.mapping'] = Devise.mappings[:user]
|
||||
sign_in(Fabricate(:user), scope: :user)
|
||||
post :update
|
||||
expect(response).to have_http_status(200)
|
||||
|
@ -49,7 +49,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
|||
|
||||
context 'when suspended' do
|
||||
it 'returns http forbidden' do
|
||||
request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
request.env['devise.mapping'] = Devise.mappings[:user]
|
||||
sign_in(Fabricate(:user, account_attributes: { username: 'test', suspended_at: Time.now.utc }), scope: :user)
|
||||
post :update
|
||||
expect(response).to have_http_status(403)
|
||||
|
@ -59,7 +59,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
|||
|
||||
describe 'GET #new' do
|
||||
before do
|
||||
request.env["devise.mapping"] = Devise.mappings[:user]
|
||||
request.env['devise.mapping'] = Devise.mappings[:user]
|
||||
end
|
||||
|
||||
context do
|
||||
|
@ -92,7 +92,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
|||
I18n.locale = current_locale
|
||||
end
|
||||
|
||||
before { request.env["devise.mapping"] = Devise.mappings[:user] }
|
||||
before { request.env['devise.mapping'] = Devise.mappings[:user] }
|
||||
|
||||
context do
|
||||
around do |example|
|
||||
|
@ -103,7 +103,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
|||
|
||||
subject do
|
||||
Setting.registrations_mode = 'open'
|
||||
request.headers["Accept-Language"] = accept_language
|
||||
request.headers['Accept-Language'] = accept_language
|
||||
post :create, params: { user: { account_attributes: { username: 'test' }, email: 'test@example.com', password: '12345678', password_confirmation: '12345678', agreement: 'true' } }
|
||||
end
|
||||
|
||||
|
@ -129,7 +129,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
|||
|
||||
subject do
|
||||
Setting.registrations_mode = 'open'
|
||||
request.headers["Accept-Language"] = accept_language
|
||||
request.headers['Accept-Language'] = accept_language
|
||||
post :create, params: { user: { account_attributes: { username: 'test' }, email: 'test@example.com', password: '12345678', password_confirmation: '12345678', agreement: 'false' } }
|
||||
end
|
||||
|
||||
|
@ -149,7 +149,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
|||
|
||||
subject do
|
||||
Setting.registrations_mode = 'approved'
|
||||
request.headers["Accept-Language"] = accept_language
|
||||
request.headers['Accept-Language'] = accept_language
|
||||
post :create, params: { user: { account_attributes: { username: 'test' }, email: 'test@example.com', password: '12345678', password_confirmation: '12345678', agreement: 'true' } }
|
||||
end
|
||||
|
||||
|
@ -176,7 +176,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
|||
|
||||
subject do
|
||||
Setting.registrations_mode = 'approved'
|
||||
request.headers["Accept-Language"] = accept_language
|
||||
request.headers['Accept-Language'] = accept_language
|
||||
invite = Fabricate(:invite, max_uses: nil, expires_at: 1.hour.ago)
|
||||
post :create, params: { user: { account_attributes: { username: 'test' }, email: 'test@example.com', password: '12345678', password_confirmation: '12345678', invite_code: invite.code, agreement: 'true' } }
|
||||
end
|
||||
|
@ -208,7 +208,7 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
|
|||
inviter = Fabricate(:user, confirmed_at: 2.days.ago)
|
||||
Setting.registrations_mode = 'approved'
|
||||
Setting.require_invite_text = true
|
||||
request.headers["Accept-Language"] = accept_language
|
||||
request.headers['Accept-Language'] = accept_language
|
||||
invite = Fabricate(:invite, user: inviter, max_uses: nil, expires_at: 1.hour.from_now)
|
||||
post :create, params: { user: { account_attributes: { username: 'test' }, email: 'test@example.com', password: '12345678', password_confirmation: '12345678', invite_code: invite.code, agreement: 'true' } }
|
||||
end
|
||||
|
|
|
@ -54,7 +54,7 @@ RSpec.describe Auth::SessionsController, type: :controller do
|
|||
context 'using PAM authentication', if: ENV['PAM_ENABLED'] == 'true' do
|
||||
context 'using a valid password' do
|
||||
before do
|
||||
post :create, params: { user: { email: "pam_user1", password: '123456' } }
|
||||
post :create, params: { user: { email: 'pam_user1', password: '123456' } }
|
||||
end
|
||||
|
||||
it 'redirects to home' do
|
||||
|
@ -68,7 +68,7 @@ RSpec.describe Auth::SessionsController, type: :controller do
|
|||
|
||||
context 'using an invalid password' do
|
||||
before do
|
||||
post :create, params: { user: { email: "pam_user1", password: 'WRONGPW' } }
|
||||
post :create, params: { user: { email: 'pam_user1', password: 'WRONGPW' } }
|
||||
end
|
||||
|
||||
it 'shows a login error' do
|
||||
|
@ -194,7 +194,7 @@ RSpec.describe Auth::SessionsController, type: :controller do
|
|||
post :create, params: { user: { email: user.email, password: user.password } }
|
||||
end
|
||||
|
||||
context "in single user mode" do
|
||||
context 'in single user mode' do
|
||||
let(:single_user_mode) { true }
|
||||
|
||||
it 'redirects to home' do
|
||||
|
@ -202,7 +202,7 @@ RSpec.describe Auth::SessionsController, type: :controller do
|
|||
end
|
||||
end
|
||||
|
||||
context "in non-single user mode" do
|
||||
context 'in non-single user mode' do
|
||||
let(:single_user_mode) { false }
|
||||
|
||||
it "redirects back to the user's page" do
|
||||
|
@ -230,8 +230,8 @@ RSpec.describe Auth::SessionsController, type: :controller do
|
|||
end
|
||||
|
||||
it 'renders two factor authentication page' do
|
||||
expect(controller).to render_template("two_factor")
|
||||
expect(controller).to render_template(partial: "_otp_authentication_form")
|
||||
expect(controller).to render_template('two_factor')
|
||||
expect(controller).to render_template(partial: '_otp_authentication_form')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -246,8 +246,8 @@ RSpec.describe Auth::SessionsController, type: :controller do
|
|||
end
|
||||
|
||||
it 'renders two factor authentication page' do
|
||||
expect(controller).to render_template("two_factor")
|
||||
expect(controller).to render_template(partial: "_otp_authentication_form")
|
||||
expect(controller).to render_template('two_factor')
|
||||
expect(controller).to render_template(partial: '_otp_authentication_form')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -257,8 +257,8 @@ RSpec.describe Auth::SessionsController, type: :controller do
|
|||
end
|
||||
|
||||
it 'renders two factor authentication page' do
|
||||
expect(controller).to render_template("two_factor")
|
||||
expect(controller).to render_template(partial: "_otp_authentication_form")
|
||||
expect(controller).to render_template('two_factor')
|
||||
expect(controller).to render_template(partial: '_otp_authentication_form')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -359,8 +359,8 @@ RSpec.describe Auth::SessionsController, type: :controller do
|
|||
end
|
||||
|
||||
it 'renders webauthn authentication page' do
|
||||
expect(controller).to render_template("two_factor")
|
||||
expect(controller).to render_template(partial: "_webauthn_form")
|
||||
expect(controller).to render_template('two_factor')
|
||||
expect(controller).to render_template(partial: '_webauthn_form')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -370,8 +370,8 @@ RSpec.describe Auth::SessionsController, type: :controller do
|
|||
end
|
||||
|
||||
it 'renders webauthn authentication page' do
|
||||
expect(controller).to render_template("two_factor")
|
||||
expect(controller).to render_template(partial: "_webauthn_form")
|
||||
expect(controller).to render_template('two_factor')
|
||||
expect(controller).to render_template(partial: '_webauthn_form')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue