* Update check answers to use the correct logs
* Display different link when correcting duplicates
* allow deduplicating logs by changing the answers
* Route back to the initial log if it still has duplicates
* Update back to log button
* Add banner
* Update success banner
* Fix a flaky test
* Rename param and update conditionals
* Add owning organisation to deduplication fields, only return back to the original log if it still belongs to the org
deduplication_success_banner:"%{log_link} is no longer a duplicate and has been removed from the list.<p class=\"govuk-body govuk-!-margin-top-4\">You changed the %{changed_question_label}.</p>"
expect(page).tohave_link("Keep this log and delete duplicates",count:3)
expect(page).tohave_link("Keep this log and delete duplicates",href:"/lettings-logs/#{lettings_log.id}/delete-duplicates?original_log_id=#{lettings_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/lettings-logs/#{duplicate_logs.first.id}/delete-duplicates?original_log_id=#{lettings_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/lettings-logs/#{duplicate_logs.second.id}/delete-duplicates?original_log_id=#{lettings_log.id}")
end
end
end
it"displays buttons to delete"do
context"when there are no more duplicate logs"do
expect(page).tohave_link("Keep this log and delete duplicates",count:3)
beforedo
expect(page).tohave_link("Keep this log and delete duplicates",href:"/lettings-logs/#{lettings_log.id}/delete-duplicates?original_log_id=#{lettings_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/lettings-logs/#{duplicate_logs.first.id}/delete-duplicates?original_log_id=#{lettings_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/lettings-logs/#{duplicate_logs.second.id}/delete-duplicates?original_log_id=#{lettings_log.id}")
end
it"displays check your answers for each log with correct questions"do
expect(page).tohave_link("Keep this log and delete duplicates",count:3)
expect(page).tohave_link("Keep this log and delete duplicates",href:"/sales-logs/#{sales_log.id}/delete-duplicates?original_log_id=#{sales_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/sales-logs/#{duplicate_logs.first.id}/delete-duplicates?original_log_id=#{sales_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/sales-logs/#{duplicate_logs.second.id}/delete-duplicates?original_log_id=#{sales_log.id}")
end
end
end
it"displays buttons to delete"do
context"when there are no more duplicate logs"do
expect(page).tohave_link("Keep this log and delete duplicates",count:3)
beforedo
expect(page).tohave_link("Keep this log and delete duplicates",href:"/sales-logs/#{sales_log.id}/delete-duplicates?original_log_id=#{sales_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/sales-logs/#{duplicate_logs.first.id}/delete-duplicates?original_log_id=#{sales_log.id}")
expect(page).tohave_link("Keep this log and delete duplicates",href:"/sales-logs/#{duplicate_logs.second.id}/delete-duplicates?original_log_id=#{sales_log.id}")
end
it"displays check your answers for each log with correct questions"do
expect(page).tohave_content("Q1 - Sale completion date",count:1)