* 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
21 lines
494 B
Ruby
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
|