diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 891fc905cd..6fc97ab5ed 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -34,11 +34,11 @@ module ApplicationHelper Setting.registrations_mode == 'none' end - def available_sign_up_path + def available_sign_up_url if closed_registrations? || omniauth_only? - 'https://joinmastodon.org/#getting-started' + 'https://joinmastodon.org/' else - ENV.fetch('SSO_ACCOUNT_SIGN_UP', new_user_registration_path) + ENV.fetch('SSO_ACCOUNT_SIGN_UP', new_user_registration_url) end end diff --git a/app/views/auth/shared/_links.html.haml b/app/views/auth/shared/_links.html.haml index 757ef0a090..f328fd91ac 100644 --- a/app/views/auth/shared/_links.html.haml +++ b/app/views/auth/shared/_links.html.haml @@ -6,7 +6,7 @@ %li= link_to_login t('auth.login') - if controller_name != 'registrations' - %li= link_to t('auth.register'), available_sign_up_path + %li= link_to t('auth.register'), available_sign_up_url - if controller_name != 'passwords' && controller_name != 'registrations' %li= link_to t('auth.forgot_password'), new_user_password_path diff --git a/app/views/email_subscription_mailer/notification.html.haml b/app/views/email_subscription_mailer/notification.html.haml index ad816ba460..12848c59b3 100644 --- a/app/views/email_subscription_mailer/notification.html.haml +++ b/app/views/email_subscription_mailer/notification.html.haml @@ -27,7 +27,7 @@ /[if mso] %div - = render 'application/mailer/button', text: t('.create_account'), url: available_sign_up_path, has_arrow: false + = render 'application/mailer/button', text: t('.create_account'), url: available_sign_up_url, has_arrow: false /[if mso] diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 46dbd80de0..1b95be1d33 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -94,14 +94,14 @@ RSpec.describe ApplicationHelper do end end - describe 'available_sign_up_path' do + describe 'available_sign_up_url' do context 'when registrations are closed' do before do allow(Setting).to receive(:[]).with('registrations_mode').and_return 'none' end it 'redirects to joinmastodon site' do - expect(helper.available_sign_up_path).to match(/joinmastodon.org/) + expect(helper.available_sign_up_url).to match(/joinmastodon.org/) end end @@ -113,13 +113,13 @@ RSpec.describe ApplicationHelper do end it 'redirects to joinmastodon site' do - expect(helper.available_sign_up_path).to match(/joinmastodon.org/) + expect(helper.available_sign_up_url).to match(/joinmastodon.org/) end end context 'when registrations are allowed' do it 'returns a link to the registration page' do - expect(helper.available_sign_up_path).to eq(new_user_registration_path) + expect(helper.available_sign_up_url).to eq(new_user_registration_url) end end end