From d3cc4212259d2c31fb2274b89bbf6a6b031ebbd2 Mon Sep 17 00:00:00 2001 From: Dominik Kwiatek Date: Wed, 21 Oct 2020 13:49:12 +0200 Subject: [PATCH] Rename settings partials to match naming conventions --- app/views/settings/_security.haml | 4 ++-- .../security/{_totp-enabled.haml => _totp_enabled.haml} | 0 .../settings/security/{_totp-setup.haml => _totp_setup.haml} | 0 spec/controllers/user_controller_spec.rb | 4 ++-- 4 files changed, 4 insertions(+), 4 deletions(-) rename app/views/settings/security/{_totp-enabled.haml => _totp_enabled.haml} (100%) rename app/views/settings/security/{_totp-setup.haml => _totp_setup.haml} (100%) diff --git a/app/views/settings/_security.haml b/app/views/settings/_security.haml index 5217bc6a..e9bfa3b4 100644 --- a/app/views/settings/_security.haml +++ b/app/views/settings/_security.haml @@ -2,6 +2,6 @@ .card-body %h2= t('views.settings.security.2fa.title') - if current_user.otp_module_disabled? - = render partial: 'settings/security/totp-setup', locals: { qr_svg: qr_svg } + = render partial: 'settings/totp_setup', locals: { qr_svg: qr_svg } - else - = render partial: 'settings/security/totp-enabled' + = render partial: 'settings/totp_enabled' diff --git a/app/views/settings/security/_totp-enabled.haml b/app/views/settings/security/_totp_enabled.haml similarity index 100% rename from app/views/settings/security/_totp-enabled.haml rename to app/views/settings/security/_totp_enabled.haml diff --git a/app/views/settings/security/_totp-setup.haml b/app/views/settings/security/_totp_setup.haml similarity index 100% rename from app/views/settings/security/_totp-setup.haml rename to app/views/settings/security/_totp_setup.haml diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index dea62bc3..b4bf4b01 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -74,7 +74,7 @@ describe UserController, type: :controller do it "shows a setup form for users who don't have 2FA enabled" do subject expect(response).to have_rendered(:edit_security) - expect(response).to have_rendered(partial: 'settings/security/_totp-setup') + expect(response).to have_rendered(partial: 'settings/security/_totp_setup') end it "shows the option to disable 2FA for users who have 2FA already enabled" do @@ -83,7 +83,7 @@ describe UserController, type: :controller do subject expect(response).to have_rendered(:edit_security) - expect(response).to have_rendered(partial: 'settings/security/_totp-enabled') + expect(response).to have_rendered(partial: 'settings/security/_totp_enabled') end end end