* Rename SiteConfig * More renaming * Update spec * Update mandatory settings mapping * More renaming * e2e test fixes * You have a rename, and you have a rename * Spec fix * More changes * Temporarily disable specs * After-merge update * Undo rename for migration * undo rename of DUS * Fix DUS * Fix merge problem * Remove redundant DUS * Fix specs * Remove unused code * Change wrong class name * More cleanup * Re-add missing values to constant * Fix constant * Fix spec * Remove obsolete fields * Add accidentally removed field * Update spec * Move methods from Settings::General to ForemInstance * Remove unneeded model * Change mentions of 'site config'
31 lines
882 B
Ruby
31 lines
882 B
Ruby
require "rails_helper"
|
|
|
|
RSpec.describe SitemapRefreshWorker, type: :woker do
|
|
include_examples "#enqueues_on_correct_queue", "low_priority"
|
|
|
|
describe "#perform" do
|
|
let(:worker) { subject }
|
|
let(:mock_task) { instance_double(Rake::Task, invoke: true) }
|
|
|
|
before do
|
|
allow(Rails.application).to receive(:load_tasks)
|
|
allow(Rake::Task).to receive(:[]).and_return(mock_task)
|
|
end
|
|
|
|
it "runs sitemap:refresh:no_ping Rake task locally" do
|
|
allow(ForemInstance).to receive(:local?).and_return(true)
|
|
|
|
worker.perform
|
|
|
|
expect(Rake::Task).to have_received(:[]).with("sitemap:refresh:no_ping")
|
|
end
|
|
|
|
it "runs sitemap:refresh Rake task on regular installations" do
|
|
allow(ForemInstance).to receive(:local?).and_return(false)
|
|
|
|
worker.perform
|
|
|
|
expect(Rake::Task).to have_received(:[]).with("sitemap:refresh")
|
|
end
|
|
end
|
|
end
|