From 0852994b672ff7ebbb725afca2665a71a24982e8 Mon Sep 17 00:00:00 2001 From: Brett McHargue Date: Wed, 8 Nov 2023 16:15:18 +0000 Subject: [PATCH] Fix rubocop and update default user password --- db/seeds/users.yml | 6 +++--- lib/tasks/eyfs.rake | 2 +- spec/controllers/user_controller_spec.rb | 4 ++-- spec/factories/users.rb | 2 +- spec/lib/seed_snippets_spec.rb | 2 +- spec/system/registered_user/changing_password_spec.rb | 4 ++-- spec/system/sign_in_spec.rb | 2 +- ui/pages/sign_in.rb | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/db/seeds/users.yml b/db/seeds/users.yml index 34dffc07c..5cc1d9faf 100644 --- a/db/seeds/users.yml +++ b/db/seeds/users.yml @@ -1,15 +1,15 @@ --- registered@example.com: - password: <%= ENV.fetch('USER_PASSWORD', 'StrongPassword12!@') %> + password: <%= ENV.fetch('USER_PASSWORD', 'Str0ngPa$$word') %> terms_and_conditions_agreed_at: <%= 1.minute.ago %> confirmed@example.com: - password: <%= ENV.fetch('USER_PASSWORD', 'StrongPassword12!@') %> + password: <%= ENV.fetch('USER_PASSWORD', 'Str0ngPa$$w0rd12') %> terms_and_conditions_agreed_at: <%= 1.minute.ago %> confirmed_at: <%= 1.minute.ago %> completed@example.com: - password: <%= ENV.fetch('USER_PASSWORD', 'StrongPassword12!@') %> + password: <%= ENV.fetch('USER_PASSWORD', 'Str0ngPa$$w0rd') %> terms_and_conditions_agreed_at: <%= 1.minute.ago %> confirmed_at: <%= 1.minute.ago %> first_name: Demo diff --git a/lib/tasks/eyfs.rake b/lib/tasks/eyfs.rake index 38545f449..01dbdba68 100644 --- a/lib/tasks/eyfs.rake +++ b/lib/tasks/eyfs.rake @@ -9,7 +9,7 @@ namespace :eyfs do unless User.find_by(email: "#{bot_token}@example.com") User.create!( email: "#{bot_token}@example.com", - password: ENV.fetch('USER_PASSWORD', 'StrongPassword12!@'), + password: ENV.fetch('USER_PASSWORD', 'Str0ngPa$$w0rd'), confirmed_at: Time.zone.now, terms_and_conditions_agreed_at: Time.zone.now, first_name: 'Bot', diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 6037ca474..358ddfc94 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -54,7 +54,7 @@ { password: 'NewPassword12!@', confirm_password: 'NewPassword12!@', - current_password: 'StrongPassword12!@', + current_password: 'Str0ngPa$$w0rd', } end @@ -90,7 +90,7 @@ { password: '', confirm_password: '', - current_password: 'StrongPassword12!@', + current_password: 'Str0ngPa$$w0rd', } end diff --git a/spec/factories/users.rb b/spec/factories/users.rb index 0a41c614f..2b339dee9 100644 --- a/spec/factories/users.rb +++ b/spec/factories/users.rb @@ -1,7 +1,7 @@ FactoryBot.define do factory :user do email { Faker::Internet.email } - password { 'StrongPassword12!@' } + password { 'Str0ngPa$$w0rd' } terms_and_conditions_agreed_at { Date.new(2000, 0o1, 0o1) } trait :confirmed do diff --git a/spec/lib/seed_snippets_spec.rb b/spec/lib/seed_snippets_spec.rb index bb33ec74a..89e91259b 100644 --- a/spec/lib/seed_snippets_spec.rb +++ b/spec/lib/seed_snippets_spec.rb @@ -5,7 +5,7 @@ subject(:locales) { described_class.new.call } it 'converts all translations' do - expect(locales.count).to be 181 + expect(locales.count).to be 181 end it 'dot separated key -> Page::Resource#name' do diff --git a/spec/system/registered_user/changing_password_spec.rb b/spec/system/registered_user/changing_password_spec.rb index e2c1df479..47679ba47 100644 --- a/spec/system/registered_user/changing_password_spec.rb +++ b/spec/system/registered_user/changing_password_spec.rb @@ -3,13 +3,13 @@ RSpec.describe 'Registered user changing password', type: :system do subject(:user) { create :user, :registered, created_at: 1.month.ago } - let(:password) { 'StrongPassword12!@' } + let(:password) { 'Str0ngPa$$w0rd' } include_context 'with user' before do visit '/my-account/edit-password' - fill_in 'Enter your current password', with: 'StrongPassword12!@' + fill_in 'Enter your current password', with: 'Str0ngPa$$w0rd' fill_in 'Create a new password', with: password fill_in 'Confirm password', with: password end diff --git a/spec/system/sign_in_spec.rb b/spec/system/sign_in_spec.rb index e730f94d4..a55ae8c2c 100644 --- a/spec/system/sign_in_spec.rb +++ b/spec/system/sign_in_spec.rb @@ -2,7 +2,7 @@ RSpec.describe 'Sign in' do let(:email_address) { user.email } - let(:password) { 'StrongPassword12!@' } + let(:password) { 'Str0ngPa$$w0rd' } before do visit '/users/sign-in' diff --git a/ui/pages/sign_in.rb b/ui/pages/sign_in.rb index b209adcad..18e141b34 100644 --- a/ui/pages/sign_in.rb +++ b/ui/pages/sign_in.rb @@ -11,12 +11,12 @@ class SignIn < Base # Authenticate using email and password # # @param email [String] login email address (default: completed@example.com) - # @param password [String] login password (default: StrongPassword12!@) + # @param password [String] login password (default: Str0ngPa$$w0rd) def with_email_and_password(email = nil, password = nil) wait_until_header_visible email ||= 'completed@example.com' - password ||= ENV.fetch('USER_PASSWORD', 'StrongPassword12!@') + password ||= ENV.fetch('USER_PASSWORD', 'Str0ngPa$$w0rd') email_field.set(email) password_field.set(password)