From b3b5bf26d14f809a562244642949826b6a91bade Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Wed, 3 Dec 2025 10:34:10 -0500 Subject: [PATCH] Remove duplicate `set_locale` around action in auth/registrations (#36455) --- app/controllers/auth/registrations_controller.rb | 2 +- spec/system/auth/registrations_spec.rb | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb index 780c0be319..b8c21f3ccd 100644 --- a/app/controllers/auth/registrations_controller.rb +++ b/app/controllers/auth/registrations_controller.rb @@ -135,7 +135,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController @accept_token = session[:accept_token] = SecureRandom.hex @invite_code = invite_code - set_locale { render :rules } + render :rules end def is_flashing_format? # rubocop:disable Naming/PredicatePrefix diff --git a/spec/system/auth/registrations_spec.rb b/spec/system/auth/registrations_spec.rb index 4c08bf47ee..3a103667e6 100644 --- a/spec/system/auth/registrations_spec.rb +++ b/spec/system/auth/registrations_spec.rb @@ -3,6 +3,17 @@ require 'rails_helper' RSpec.describe 'Auth Registration' do + context 'when there are server rules' do + let!(:rule) { Fabricate :rule, text: 'You must be seven meters tall' } + + it 'shows rules page before proceeding with sign up' do + visit new_user_registration_path + expect(page) + .to have_title(I18n.t('auth.register')) + .and have_content(rule.text) + end + end + context 'when age verification is enabled' do before { Setting.min_age = 16 }