diff --git a/app/models/scheme.rb b/app/models/scheme.rb index 587698d3a..e2036c7ed 100644 --- a/app/models/scheme.rb +++ b/app/models/scheme.rb @@ -107,7 +107,7 @@ class Scheme < ApplicationRecord def check_secondary_client_confirmation_attributes [ - { name: "Scheme provides for another client group", value: has_other_client_group }, + { name: "Has another client group", value: has_other_client_group }, ] end diff --git a/app/views/schemes/check_answers.html.erb b/app/views/schemes/check_answers.html.erb index bef9526fc..64f64a77c 100644 --- a/app/views/schemes/check_answers.html.erb +++ b/app/views/schemes/check_answers.html.erb @@ -36,14 +36,16 @@ ) %> <% end %> <% end %> - <% @scheme.check_secondary_client_attributes.each do |attr| %> - <%= summary_list.row do |row| %> - <% row.key { attr[:name].to_s } %> - <% row.value { details_html(attr) } %> - <% row.action( - text: "Change", - href: scheme_secondary_client_group_path(scheme_id: @scheme.id, check_answers: true), - ) %> + <% if @scheme.has_other_client_group == "Yes" %> + <% @scheme.check_secondary_client_attributes.each do |attr| %> + <%= summary_list.row do |row| %> + <% row.key { attr[:name].to_s } %> + <% row.value { details_html(attr) } %> + <% row.action( + text: "Change", + href: scheme_secondary_client_group_path(scheme_id: @scheme.id, check_answers: true), + ) %> + <% end %> <% end %> <% end %> <% @scheme.check_support_attributes.each do |attr| %> diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index ad8be1930..b815960f6 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -353,17 +353,6 @@ RSpec.describe "Schemes scheme Features" do expect(page).to have_content "Check your changes before updating this scheme" end - context "when I press the back button" do - before do - click_link "Back" - end - - it "lets me select the support answers" do - expect(page).to have_current_path("/schemes/#{scheme.id}/support") - expect(page).to have_content "What support does this scheme provide?" - end - end - context "when changing answers" do it "displays change links" do assert_selector "a", text: "Change", count: 12 @@ -456,7 +445,6 @@ RSpec.describe "Schemes scheme Features" do expect(page).to have_content "Check your changes before updating this scheme" end end - end context "allows changing confirm-secondary-client-group question to no" do @@ -471,7 +459,7 @@ RSpec.describe "Schemes scheme Features" do click_button "Save and continue" expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") - expect(page).to have_content "None" + expect(page).not_to have_content "Secondary client group" end end