Browse Source

Update affected logs label

pull/981/head
Kat 4 years ago
parent
commit
0e9bf8c1d7
  1. 1
      app/models/location.rb
  2. 2
      app/views/locations/toggle_active_confirm.html.erb
  3. 4
      spec/requests/locations_controller_spec.rb

1
app/models/location.rb

@ -2,6 +2,7 @@ class Location < ApplicationRecord
validate :validate_postcode
validates :units, :type_of_unit, :mobility_type, presence: true
belongs_to :scheme
has_many :lettings_logs, class_name: "LettingsLog"
has_paper_trail

2
app/views/locations/toggle_active_confirm.html.erb

@ -4,7 +4,7 @@
<% end %>
<h1 class="govuk-heading-l">
<span class="govuk-caption-l"><%= @scheme.service_name %></span>
<%= "This change will affect SOME logs" %>
<%= "This change will affect #{@location.lettings_logs.count} logs" %>
</h1>
<%= govuk_warning_text text: I18n.t("warnings.location.deactivation.review_logs") %>
<%= f.hidden_field :confirm, :value => true %>

4
spec/requests/locations_controller_spec.rb

@ -1253,7 +1253,7 @@ RSpec.describe LocationsController, type: :request do
it "renders the confirmation page" do
expect(response).to have_http_status(:ok)
expect(page).to have_content("This change will affect SOME logs")
expect(page).to have_content("This change will affect #{location.lettings_logs.count} logs")
end
end
@ -1262,7 +1262,7 @@ RSpec.describe LocationsController, type: :request do
it "renders the confirmation page" do
expect(response).to have_http_status(:ok)
expect(page).to have_content("This change will affect SOME logs")
expect(page).to have_content("This change will affect #{location.lettings_logs.count} logs")
end
end

Loading…
Cancel
Save