Browse Source

Check links instead of content (#1632)

pull/1624/head
kosiakkatrina 2 years ago committed by GitHub
parent
commit
0020119a27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      spec/requests/lettings_logs_controller_spec.rb

8
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

Loading…
Cancel
Save