Browse Source

Test fix

pull/1784/head
Jack S 3 years ago
parent
commit
82df4bdab9
  1. 4
      spec/requests/lettings_logs_controller_spec.rb
  2. 5
      spec/requests/sales_logs_controller_spec.rb

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