Browse Source

CLDC-2500 Add "log" in front of ID (#1784)

* Add "log" in front of ID

* Test fix
pull/1786/head
Jack 1 year ago committed by GitHub
parent
commit
436f8d59d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/components/lettings_log_summary_component.html.erb
  2. 2
      app/components/sales_log_summary_component.html.erb
  3. 4
      spec/requests/lettings_logs_controller_spec.rb
  4. 5
      spec/requests/sales_logs_controller_spec.rb

2
app/components/lettings_log_summary_component.html.erb

@ -4,7 +4,7 @@
<header class="app-log-summary__header"> <header class="app-log-summary__header">
<h2 class="app-log-summary__title"> <h2 class="app-log-summary__title">
<%= govuk_link_to lettings_log_path(log) do %> <%= govuk_link_to lettings_log_path(log) do %>
<span class="govuk-visually-hidden">Log </span><%= log.id %> Log <%= log.id %>
<% end %> <% end %>
</h2> </h2>
<% if log.tenancycode? or log.propcode? %> <% if log.tenancycode? or log.propcode? %>

2
app/components/sales_log_summary_component.html.erb

@ -4,7 +4,7 @@
<header class="app-log-summary__header"> <header class="app-log-summary__header">
<h2 class="app-log-summary__title"> <h2 class="app-log-summary__title">
<%= govuk_link_to sales_log_path(log) do %> <%= govuk_link_to sales_log_path(log) do %>
<span class="govuk-visually-hidden">Log </span><%= log.id %> Log <%= log.id %>
<% end %> <% end %>
</h2> </h2>
<dl class="app-metadata app-metadata--inline"> <dl class="app-metadata app-metadata--inline">

4
spec/requests/lettings_logs_controller_spec.rb

@ -731,8 +731,8 @@ RSpec.describe LettingsLogsController, type: :request do
end end
it "only shows lettings logs for your organisation" do it "only shows lettings logs for your organisation" do
expected_case_row_log = "<span class=\"govuk-visually-hidden\">Log </span>#{lettings_log.id}" expected_case_row_log = "Log #{lettings_log.id}"
unauthorized_case_row_log = "<span class=\"govuk-visually-hidden\">Log </span>#{unauthorized_lettings_log.id}" unauthorized_case_row_log = "Log #{unauthorized_lettings_log.id}"
expect(CGI.unescape_html(response.body)).to include(expected_case_row_log) expect(CGI.unescape_html(response.body)).to include(expected_case_row_log)
expect(CGI.unescape_html(response.body)).not_to include(unauthorized_case_row_log) expect(CGI.unescape_html(response.body)).not_to include(unauthorized_case_row_log)
end end

5
spec/requests/sales_logs_controller_spec.rb

@ -552,8 +552,9 @@ RSpec.describe SalesLogsController, type: :request do
end end
it "only shows sales logs for your organisation" do it "only shows sales logs for your organisation" do
expected_case_row_log = "<span class=\"govuk-visually-hidden\">Log </span>#{sales_log.id}" expected_case_row_log = "Log #{sales_log.id}"
unauthorized_case_row_log = "<span class=\"govuk-visually-hidden\">Log </span>#{unauthorized_sales_log.id}" unauthorized_case_row_log = "Log #{unauthorized_sales_log.id}"
expect(CGI.unescape_html(response.body)).to include(expected_case_row_log) expect(CGI.unescape_html(response.body)).to include(expected_case_row_log)
expect(CGI.unescape_html(response.body)).not_to include(unauthorized_case_row_log) expect(CGI.unescape_html(response.body)).not_to include(unauthorized_case_row_log)
end end

Loading…
Cancel
Save