diff --git a/Gemfile.lock b/Gemfile.lock
index 51a6d8e23..f34c578ab 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -20,7 +20,7 @@ GIT
GIT
remote: https://github.com/baarkerlounger/two_factor_authentication.git
- revision: 025d0a39ae971798402a7cefbd677cb15aa4983c
+ revision: 276a896d4f8f4186b199588f8b8900abb8b24a9a
specs:
two_factor_authentication (2.2.0)
devise
diff --git a/app/views/devise/two_factor_authentication/show.html.erb b/app/views/devise/two_factor_authentication/show.html.erb
index cc4738e12..1eea10171 100644
--- a/app/views/devise/two_factor_authentication/show.html.erb
+++ b/app/views/devise/two_factor_authentication/show.html.erb
@@ -1,8 +1,9 @@
<% content_for :title, "Check your phone" %>
-<%= form_with(url: "/admin/two-factor-authentication", html: { method: :put }) do |f| %>
+<%= form_with(model: resource, url: "/admin/two-factor-authentication", html: { method: :put }) do |f| %>
+ <%= f.govuk_error_summary %>
<%= content_for(:title) %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 4055cda6c..5b2994020 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -1,7 +1,7 @@
- <%= browser_title(yield(:title), @user, @organisation, @case_log, @resource) %>
+ <%= browser_title(yield(:title), @admin_user, @user, @organisation, @case_log, @resource) %>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= tag :meta, name: 'viewport', content: 'width=device-width, initial-scale=1' %>
diff --git a/spec/features/admin_panel_spec.rb b/spec/features/admin_panel_spec.rb
index 838bc1b1e..93a0e0a1f 100644
--- a/spec/features/admin_panel_spec.rb
+++ b/spec/features/admin_panel_spec.rb
@@ -38,6 +38,8 @@ RSpec.describe "Admin Panel" do
click_button("Submit")
expect(page).to have_content("Check your phone")
expect(page).to have_http_status(:unprocessable_entity)
+ expect(page).to have_title("Error")
+ expect(page).to have_selector("#error-summary-title")
end
end
end
@@ -52,6 +54,8 @@ RSpec.describe "Admin Panel" do
click_button("Submit")
expect(page).to have_content("Check your phone")
expect(page).to have_http_status(:unprocessable_entity)
+ expect(page).to have_title("Error")
+ expect(page).to have_selector("#error-summary-title")
end
end