@ -22,8 +22,8 @@
<% row.key { attr[:name] } %>
<% row.value do %>
<%= details_html(attr) %>
<% if attr[:name] == "Status" && @scheme.confirmed? && @scheme.locations.confirmed.none? %>
<span class="app-!-colour-muted">Add a location to complete this scheme</span>
<% if attr[:name] == "Status" && @scheme.confirmed? && @scheme.locations.confirmed.none? && LocationPolicy.new(current_user, @scheme.locations.new).create? %>
<span class="app-!-colour-muted">Complete this scheme by adding a location using the <%= govuk_link_to("‘locations’ tab", scheme_locations_path(@scheme)) %>.</span>
<% end %>
<% if SchemePolicy.new(current_user, @scheme).update? %>
@ -603,7 +603,8 @@ RSpec.describe SchemesController, type: :request do
it "shows the scheme as incomplete with text to explain" do
get scheme_path(specific_scheme)
expect(page).to have_content "Incomplete"
expect(page).to have_content "Add a location to complete this scheme"
expect(page).to have_content "Complete this scheme by adding a location using the"
expect(page).to have_link "‘locations’ tab"
end
@ -612,7 +613,8 @@ RSpec.describe SchemesController, type: :request do
create(:location, scheme: specific_scheme)
expect(page).to have_content "Active"
expect(page).not_to have_content "Add a location to complete this scheme"
expect(page).not_to have_content "Complete this scheme by adding a location using the"
expect(page).not_to have_link "‘locations’ tab"