Skip to content

Commit 32908d3

Browse files
committed
Refactor password usage in tests and views
- Updated password references in various test files to use a more secure password 'SecureTest123!@#' instead of 'password12345'. - Removed redundant default parameters in translation calls in offer list item views. - Added missing translation key for 'password' in locale files. - Ensured consistent password usage across all user creation and login scenarios in specs.
1 parent fe8e38b commit 32908d3

37 files changed

+75
-68
lines changed

app/views/better_together/joatu/offers/_offer_list_item.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<% response_link = joatu_offer.response_links_as_response.find { |rl| rl.source&.creator == current_person } rescue nil %>
1515
<% if response_link.present? %>
1616
<% source_type_key = response_link.source_type.demodulize.underscore rescue 'item' %>
17-
<span class="badge bg-info text-dark ms-2" style="font-size: small;"><%= t('better_together.joatu.response_to_your', type: t("better_together.joatu.type.#{source_type_key}", default: response_link.source_type.demodulize), default: "Response to your %{type}", type: t("better_together.joatu.type.#{source_type_key}", default: response_link.source_type.demodulize)) %></span>
17+
<span class="badge bg-info text-dark ms-2" style="font-size: small;"><%= t('better_together.joatu.response_to_your', type: t("better_together.joatu.type.#{source_type_key}", default: response_link.source_type.demodulize)) %></span>
1818
<% end %>
1919
<% end %>
2020
</span>

app/views/better_together/joatu/requests/_request_list_item.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<% response_link = request_model.response_links_as_response.find { |rl| rl.source&.creator == current_person } rescue nil %>
1515
<% if response_link.present? %>
1616
<% source_type_key = response_link.source_type.demodulize.underscore rescue 'item' %>
17-
<span class="badge bg-info text-dark ms-2" style="font-size: small;"><%= t('better_together.joatu.response_to_your', type: t("better_together.joatu.type.#{source_type_key}", default: response_link.source_type.demodulize), default: "Response to your %{type}", type: t("better_together.joatu.type.#{source_type_key}", default: response_link.source_type.demodulize)) %></span>
17+
<span class="badge bg-info text-dark ms-2" style="font-size: small;"><%= t('better_together.joatu.response_to_your', type: t("better_together.joatu.type.#{source_type_key}", default: response_link.source_type.demodulize)) %></span>
1818
<% end %>
1919
<% end %>
2020
</span>

config/locales/en.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ en:
409409
last_sign_in_ip: Last sign in IP
410410
lock_version: Lock version
411411
locked_at: Locked at
412+
password: Password
412413
person: :activerecord.models.person
413414
person_identification: :activerecord.models.person_identification
414415
remember_created_at: Remember created at

spec/controllers/better_together/person_blocks_controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
routes { BetterTogether::Engine.routes }
1111
let(:locale) { I18n.default_locale }
12-
let(:user) { find_or_create_test_user('[email protected]', 'password12345', :user) }
12+
let(:user) { find_or_create_test_user('[email protected]', 'SecureTest123!@#', :user) }
1313
let(:person) { user.person }
1414
let(:blocked_person) { create(:better_together_person) }
1515
let(:another_person) { create(:better_together_person) }

spec/controllers/better_together/platform_invitations_controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
routes { BetterTogether::Engine.routes }
1111
let(:locale) { I18n.default_locale }
12-
let(:user) { find_or_create_test_user('[email protected]', 'password12345', :platform_manager) }
12+
let(:user) { find_or_create_test_user('[email protected]', 'SecureTest123!@#', :platform_manager) }
1313
let(:person) { user.person }
1414
let(:platform) { create(:better_together_platform, name: 'Test Platform') }
1515
let(:platform_slug) { platform.slug }

spec/controllers/better_together/users/registrations_controller_hook_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'rails_helper'
44

5-
RSpec.describe BetterTogether::Users::RegistrationsController, :skip_host_setup do
5+
RSpec.describe BetterTogether::Users::RegistrationsController, :skip_host_setup, :user_registration do
66
include BetterTogether::CapybaraFeatureHelpers
77

88
routes { BetterTogether::Engine.routes }

spec/features/agreements/registration_consent_spec.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require 'rails_helper'
44

5-
RSpec.describe 'User registration agreements', :as_platform_manager do
5+
RSpec.describe 'User registration agreements', :as_platform_manager, :user_registration do
66
let!(:privacy_agreement) { BetterTogether::Agreement.find_by!(identifier: 'privacy_policy') }
77
# rubocop:enable RSpec/LetSetup
88
# rubocop:todo RSpec/LetSetup
@@ -13,8 +13,8 @@
1313
visit new_user_registration_path(locale: I18n.default_locale)
1414

1515
fill_in 'user[email]', with: '[email protected]'
16-
fill_in 'user[password]', with: 'password12345'
17-
fill_in 'user[password_confirmation]', with: 'password12345'
16+
fill_in 'user[password]', with: 'SecureTest123!@#'
17+
fill_in 'user[password_confirmation]', with: 'SecureTest123!@#'
1818
fill_in 'user[person_attributes][name]', with: 'Test User'
1919
fill_in 'user[person_attributes][identifier]', with: 'testuser'
2020
fill_in 'user[person_attributes][description]', with: 'Tester'
@@ -30,8 +30,8 @@
3030
visit new_user_registration_path(locale: I18n.default_locale)
3131

3232
fill_in 'user[email]', with: '[email protected]'
33-
fill_in 'user[password]', with: 'password12345'
34-
fill_in 'user[password_confirmation]', with: 'password12345'
33+
fill_in 'user[password]', with: 'SecureTest123!@#'
34+
fill_in 'user[password_confirmation]', with: 'SecureTest123!@#'
3535
fill_in 'user[person_attributes][name]', with: 'Test User'
3636
fill_in 'user[person_attributes][identifier]', with: 'testuser'
3737
fill_in 'user[person_attributes][description]', with: 'Tester'

spec/features/checklist_create_appends_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
RSpec.describe 'Checklist item creation appends to bottom', :js do
66
include ActionView::RecordIdentifier
77

8-
let(:manager) { find_or_create_test_user('[email protected]', 'password12345', :platform_manager) }
8+
let(:manager) { find_or_create_test_user('[email protected]', 'SecureTest123!@#', :platform_manager) }
99

1010
before do
1111
ensure_essential_data!

spec/features/checklist_person_completion_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
let!(:person) { create(:better_together_person, user: user) }
1010

1111
before do
12-
find_or_create_test_user('[email protected]', 'password12345', :user)
12+
find_or_create_test_user('[email protected]', 'SecureTest123!@#', :user)
1313
capybara_login_as_user
1414
end
1515

spec/features/checklist_reorder_system_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
include ActionView::RecordIdentifier
77

88
# Use the standard test manager credentials (password must meet length requirements)
9-
let(:manager) { find_or_create_test_user('[email protected]', 'password12345', :platform_manager) }
9+
let(:manager) { find_or_create_test_user('[email protected]', 'SecureTest123!@#', :platform_manager) }
1010

1111
before do
1212
# Ensure essential data exists and log in

0 commit comments

Comments
 (0)