From 2a969dfe63d2f5536589b4e17b09a488b2297797 Mon Sep 17 00:00:00 2001 From: Kat Date: Tue, 26 Jul 2022 12:07:07 +0100 Subject: [PATCH] shows incomplete tag if the scheme is not confirmed --- app/views/schemes/_scheme_list.html.erb | 2 +- spec/requests/schemes_controller_spec.rb | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/schemes/_scheme_list.html.erb b/app/views/schemes/_scheme_list.html.erb index c0a640103..6f4445164 100644 --- a/app/views/schemes/_scheme_list.html.erb +++ b/app/views/schemes/_scheme_list.html.erb @@ -29,7 +29,7 @@ <% row.cell(text: simple_format(scheme_cell(scheme), { class: "govuk-!-font-weight-bold" }, wrapper_tag: "div")) %> <% row.cell(text: scheme.locations&.count) %> <% row.cell(text: scheme.managing_organisation&.name) %> - <% row.cell(text: scheme.created_at.to_formatted_s(:govuk_date)) %> + <% row.cell(text: scheme.confirmed? ? scheme.created_at.to_formatted_s(:govuk_date) : govuk_tag(colour: "grey",text: "Incomplete")) %> <% end %> <% end %> <% end %> diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index 1b5a187fd..ff935a0e0 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -68,6 +68,12 @@ RSpec.describe SchemesController, type: :request do end end + it "shows incomplete tag if the scheme is not confirmed" do + schemes[0].update!(confirmed: nil) + get "/schemes" + assert_select ".govuk-tag", text: /Incomplete/, count: 1 + end + it "shows a search bar" do expect(page).to have_field("search", type: "search") end