From 0020119a27356431168d875bb942d1969602c012 Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Tue, 16 May 2023 10:37:00 +0100 Subject: [PATCH] Check links instead of content (#1632) --- spec/requests/lettings_logs_controller_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/requests/lettings_logs_controller_spec.rb b/spec/requests/lettings_logs_controller_spec.rb index 7f1dda118..e0c785b71 100644 --- a/spec/requests/lettings_logs_controller_spec.rb +++ b/spec/requests/lettings_logs_controller_spec.rb @@ -1138,14 +1138,14 @@ RSpec.describe LettingsLogsController, type: :request do it "only displays affected logs" do get "/lettings-logs/update-logs", headers:, params: {} expect(page).to have_content("You need to update 3 logs") - expect(page).to have_content(affected_lettings_logs.first.id) - expect(page).not_to have_content(non_affected_lettings_logs.first.id) + expect(page).to have_link("Update now", href: "/lettings-logs/#{affected_lettings_logs.first.id}/tenancy-start-date") + expect(page).not_to have_link("Update now", href: "/lettings-logs/#{non_affected_lettings_logs.first.id}/tenancy-start-date") end it "only displays the logs created by the user" do get "/lettings-logs/update-logs", headers:, params: {} - expect(page).to have_content(affected_lettings_logs.second.id) - expect(page).not_to have_content(other_user_affected_lettings_log.id) + expect(page).to have_link("Update now", href: "/lettings-logs/#{affected_lettings_logs.second.id}/tenancy-start-date") + expect(page).not_to have_link("Update now", href: "/lettings-logs/#{other_user_affected_lettings_log.id}/tenancy-start-date") expect(page).to have_content("You need to update 3 logs") end