Remove redundant tests in sitemap specs

Testing that the sitemap is valid (which we test in the following test)
also checks that the sitemap has been generated. The test will also fail
with different errors depending on whether no file was generated or the
generated file is invalid.
This commit is contained in:
Javi Martín
2022-09-26 22:00:15 +02:00
parent 9759288f3b
commit 22ffbd4d2b

View File

@@ -11,10 +11,6 @@ describe "rake sitemap:create", type: :system do
describe "when processes are enabled" do
before { Rake.application.invoke_task("sitemap:create") }
it "generates a sitemap" do
expect(file).to exist
end
it "generates a valid sitemap" do
sitemap = Nokogiri::XML(File.open(file))
expect(sitemap.errors).to be_empty
@@ -51,10 +47,6 @@ describe "rake sitemap:create", type: :system do
Rake.application.invoke_task("sitemap:create")
end
it "generates a sitemap" do
expect(file).to exist
end
it "generates a valid sitemap" do
sitemap = Nokogiri::XML(File.open(file))
expect(sitemap.errors).to be_empty