* Add missing spaces * Use filter_map over map + reject/compact * Simplify FactoryBot calls * Use to_h with block instead of map + to_h * Use guard clause
15 lines
372 B
Ruby
15 lines
372 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe Users::BustCacheWorker, type: :worker do
|
|
describe "#perform" do
|
|
let(:user) { create(:user) }
|
|
let(:worker) { subject }
|
|
|
|
it "busts cache" do
|
|
allow(EdgeCache::BustUser).to receive(:call).with(user)
|
|
|
|
worker.perform(user.id)
|
|
expect(EdgeCache::BustUser).to have_received(:call).with(user)
|
|
end
|
|
end
|
|
end
|