From 3f664e4ccd6638f840e50b72ab9a56f8375d5544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 11 Aug 2022 15:35:50 +0200 Subject: [PATCH] Don't ask verified users to verify their account It was strange to tell users they need to verify their account in order to perform all available actions when they've already verified their account. --- .../account/verify_account_component.html.erb | 34 ++++++++----------- .../account/verify_account_component.rb | 4 +++ .../account/verify_account_component_spec.rb | 7 ++-- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/app/components/account/verify_account_component.html.erb b/app/components/account/verify_account_component.html.erb index 3de7bee3d..bcd6c1880 100644 --- a/app/components/account/verify_account_component.html.erb +++ b/app/components/account/verify_account_component.html.erb @@ -1,22 +1,18 @@ -
-

- <%= t("account.show.user_permission_verify") %> -

+ diff --git a/app/components/account/verify_account_component.rb b/app/components/account/verify_account_component.rb index 93a2bb7f1..c1aa09c26 100644 --- a/app/components/account/verify_account_component.rb +++ b/app/components/account/verify_account_component.rb @@ -4,4 +4,8 @@ class Account::VerifyAccountComponent < ApplicationComponent def initialize(account) @account = account end + + def render? + !account.organization? + end end diff --git a/spec/components/account/verify_account_component_spec.rb b/spec/components/account/verify_account_component_spec.rb index bb34e506a..a7921f716 100644 --- a/spec/components/account/verify_account_component_spec.rb +++ b/spec/components/account/verify_account_component_spec.rb @@ -24,7 +24,7 @@ describe Account::VerifyAccountComponent do render_inline Account::VerifyAccountComponent.new(account) - expect(page).to have_content "To perform all the actions verify your account." + expect(page).not_to have_content "To perform all the actions verify your account." expect(page).to have_content "Account verified" end @@ -33,9 +33,6 @@ describe Account::VerifyAccountComponent do render_inline Account::VerifyAccountComponent.new(account) - expect(page).to have_content "To perform all the actions verify your account." - expect(page).not_to have_link "Verify my account" - expect(page).not_to have_link "Complete verification" - expect(page).not_to have_content "Account verified" + expect(page).not_to be_rendered end end