We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a following RSpec code to test the sitemap generation:
require "rails_helper" RSpec.describe RefreshSitemapsJob do subject(:generate_sitemap) { described_class.new.perform } around { |spec| travel_to(Time.zone.local(2022, 5, 15, 13, 14, 15)) { spec.run } } def parse_xml(file_path) File.open(file_path) { |f| Nokogiri::XML(f) }.to_s end it "generates a sitemap", :aggregate_failures do generate_sitemap expect(parse_xml("public/sitemap.xml")).to eq(parse_xml("spec/fixtures/sitemap.xml")) end end
then the worker that generates the Sitemap has a code similar to this:
class RefreshSitemapsJob include Sidekiq::Worker def perform SitemapGenerator::Sitemap.create do group(filename: :sitemap_products, max_sitemap_links: 3_000) do Product.find_each do |product| add product_path(id: product), lastmod: product.updated_at end end end end end
The expectation fails on the following diff:
<sitemapindex xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd"> <loc>http://localhost:3000/sitemap_products.xml</loc> - <lastmod>2023-05-15T13:14:15+01:00</lastmod> + <lastmod>2023-05-16T11:03:23+01:00</lastmod> </sitemap> </sitemapindex>
(the time just keeps ticking normally when the sitemap generates the group.
group
This leads me to believe that the library is doing something that does not respect the time freeze I'm doing in the around block.
around
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
I have a following RSpec code to test the sitemap generation:
then the worker that generates the Sitemap has a code similar to this:
The expectation fails on the following diff:
(the time just keeps ticking normally when the sitemap generates the
group
.This leads me to believe that the library is doing something that does not respect the time freeze I'm doing in the
around
block.The text was updated successfully, but these errors were encountered: