docbrown/spec/workers/page_view_rollup_worker_spec.rb
Mac Siri 092ee4a425
Implement PageViewRollup (#20670)
* Refactor

* Create PageViewRollup WIP

* Create PageViewRollupWorker and specs

* Add spec WIP

* Write spec

* Refactor

* Add spec

* Prevent retry

* Update baseline date

* Improve specs

* Update ATTRIBUTES_

* Update spec again
2024-03-18 20:33:12 +00:00

21 lines
494 B
Ruby

require "rails_helper"
RSpec.describe PageViewRollupWorker, type: :worker do
subject(:worker) { described_class.new }
before do
allow(PageViewRollup).to receive(:rollup)
end
include_examples "#enqueues_on_correct_queue", "low_priority"
describe "#perform" do
it "rollups five month ago" do
Time.freeze do
one_year_ago = 1.year.ago
worker.perform
expect(PageViewRollup).to have_received(:rollup).with(one_year_ago)
end
end
end
end