From cc87bca50053774879a35e07273d54c76afedd5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Mon, 26 Sep 2022 22:31:20 +0200 Subject: [PATCH] Use have_content in sitemap tests That's what we're using in most of our tests, and we were using it in some expectations in these tests as well. --- spec/lib/tasks/sitemap_spec.rb | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/spec/lib/tasks/sitemap_spec.rb b/spec/lib/tasks/sitemap_spec.rb index dd6641063..0edbf19f4 100644 --- a/spec/lib/tasks/sitemap_spec.rb +++ b/spec/lib/tasks/sitemap_spec.rb @@ -20,16 +20,16 @@ describe "rake sitemap:create", type: :system do sitemap = File.read(file) # Static pages - expect(sitemap).to include(faq_path) - expect(sitemap).to include(help_path) - expect(sitemap).to include(how_to_use_path) + expect(sitemap).to have_content(faq_path) + expect(sitemap).to have_content(help_path) + expect(sitemap).to have_content(how_to_use_path) # Dynamic URLs - expect(sitemap).to include(polls_path) - expect(sitemap).to include(budgets_path) - expect(sitemap).to include(debates_path) - expect(sitemap).to include(proposals_path) - expect(sitemap).to include(legislation_processes_path) + expect(sitemap).to have_content(polls_path) + expect(sitemap).to have_content(budgets_path) + expect(sitemap).to have_content(debates_path) + expect(sitemap).to have_content(proposals_path) + expect(sitemap).to have_content(legislation_processes_path) expect(sitemap).to have_content("0.7", count: 5) expect(sitemap).to have_content("daily", count: 5) @@ -56,16 +56,16 @@ describe "rake sitemap:create", type: :system do sitemap = File.read(file) # Static pages - expect(sitemap).to include(faq_path) - expect(sitemap).to include(help_path) - expect(sitemap).to include(how_to_use_path) + expect(sitemap).to have_content(faq_path) + expect(sitemap).to have_content(help_path) + expect(sitemap).to have_content(how_to_use_path) # Dynamic URLs - expect(sitemap).not_to include(polls_path) - expect(sitemap).not_to include(budgets_path) - expect(sitemap).not_to include(debates_path) - expect(sitemap).not_to include(proposals_path) - expect(sitemap).not_to include(legislation_processes_path) + expect(sitemap).not_to have_content(polls_path) + expect(sitemap).not_to have_content(budgets_path) + expect(sitemap).not_to have_content(debates_path) + expect(sitemap).not_to have_content(proposals_path) + expect(sitemap).not_to have_content(legislation_processes_path) expect(sitemap).not_to have_content("0.7") expect(sitemap).not_to have_content("daily")