From a985db24a36eb18a63793134fac1ebe42aad5281 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Wed, 5 Oct 2022 09:29:56 -0500 Subject: [PATCH 1/2] Stop using Capybara in a deprecated way The have_link with a regex is deprecated. Instead of having a negative assertion, switch this to two positive assertions --- spec/features/grouped_results_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/features/grouped_results_spec.rb b/spec/features/grouped_results_spec.rb index c02024b51..60ca3f1d9 100644 --- a/spec/features/grouped_results_spec.rb +++ b/spec/features/grouped_results_spec.rb @@ -18,7 +18,8 @@ it 'displays breadcrumbs only for component parents' do visit search_catalog_path q: 'alpha omega', group: 'true' within first('.breadcrumb-links') do - expect(page).not_to have_link(/Alpha/) + expect(page).to have_link 'National Library of Medicine. History of Medicine Division' + expect(page).to have_css 'a', count: 1 # Only one link is in the .breadcrumb-links end expect(page).to have_css '.breadcrumb-links a', text: /Series/ end From 51421354b522127ceea8f14f3f6da93b1be221d1 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Wed, 5 Oct 2022 17:10:05 -0500 Subject: [PATCH 2/2] Update spec/features/grouped_results_spec.rb Co-authored-by: Chris Beer --- spec/features/grouped_results_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/features/grouped_results_spec.rb b/spec/features/grouped_results_spec.rb index 60ca3f1d9..ce9a61c83 100644 --- a/spec/features/grouped_results_spec.rb +++ b/spec/features/grouped_results_spec.rb @@ -19,7 +19,7 @@ visit search_catalog_path q: 'alpha omega', group: 'true' within first('.breadcrumb-links') do expect(page).to have_link 'National Library of Medicine. History of Medicine Division' - expect(page).to have_css 'a', count: 1 # Only one link is in the .breadcrumb-links + expect(page).to have_link count: 1 # Only one link is in the .breadcrumb-links end expect(page).to have_css '.breadcrumb-links a', text: /Series/ end