diff --git a/app/controllers/verification_controller.rb b/app/controllers/verification_controller.rb index 6d1945af4..adb3ee345 100644 --- a/app/controllers/verification_controller.rb +++ b/app/controllers/verification_controller.rb @@ -11,7 +11,9 @@ class VerificationController < ApplicationController private def next_step_path(user = current_user) - if user.level_three_verified? + if user.organization? + { path: account_path } + elsif user.level_three_verified? { path: account_path, notice: t('verification.redirect_notices.already_verified') } elsif user.verification_letter_sent? { path: edit_letter_path } diff --git a/app/views/account/show.html.erb b/app/views/account/show.html.erb index d580052e2..b1382ce4c 100644 --- a/app/views/account/show.html.erb +++ b/app/views/account/show.html.erb @@ -1,22 +1,22 @@
<%= link_to t("account.show.change_credentials_link"), edit_user_registration_path, class: "button radius small secondary right" %> - -
- -
- + <% unless @account.organization? %> +
+ +
+ <% end %>

<%= t("account.show.title") %>

<%= form_for @account, as: :account, url: account_path do |f| %> diff --git a/spec/features/verification/verification_path_spec.rb b/spec/features/verification/verification_path_spec.rb index 2967f5e2f..bfd284500 100644 --- a/spec/features/verification/verification_path_spec.rb +++ b/spec/features/verification/verification_path_spec.rb @@ -2,6 +2,16 @@ require 'rails_helper' feature 'Verification path' do + scenario "User is an organization" do + user = create(:user, verified_at: Time.now) + create(:organization, user: user) + + login_as(user) + visit verification_path + + expect(current_path).to eq account_path + end + scenario "User is verified" do user = create(:user, verified_at: Time.now)