diff --git a/app/jobs/sitemap_indexer_job.rb b/app/jobs/sitemap_indexer_job.rb index d27d5e7d36..c076ee6efe 100644 --- a/app/jobs/sitemap_indexer_job.rb +++ b/app/jobs/sitemap_indexer_job.rb @@ -1,5 +1,5 @@ class SitemapIndexerJob < ApplicationJob - queue_as :searchgov + queue_as :sitemap def perform(sitemap_url:) SitemapIndexer.new(sitemap_url: sitemap_url).index diff --git a/app/jobs/sitemap_monitor_job.rb b/app/jobs/sitemap_monitor_job.rb index 1f15f5e0ce..7344cfc494 100644 --- a/app/jobs/sitemap_monitor_job.rb +++ b/app/jobs/sitemap_monitor_job.rb @@ -1,5 +1,5 @@ class SitemapMonitorJob < ApplicationJob - queue_as :searchgov + queue_as :sitemap def perform SearchgovDomain.ok.each do |searchgov_domain| diff --git a/spec/jobs/sitemap_indexer_job_spec.rb b/spec/jobs/sitemap_indexer_job_spec.rb index 3404e63f05..9735f16167 100644 --- a/spec/jobs/sitemap_indexer_job_spec.rb +++ b/spec/jobs/sitemap_indexer_job_spec.rb @@ -8,7 +8,7 @@ let(:indexer) { instance_double(SitemapIndexer) } subject(:perform) { SitemapIndexerJob.perform_now(args) } - it_behaves_like 'a searchgov job' + it_behaves_like 'a sitemap job' it 'indexes the sitemap' do allow(SitemapIndexer).to receive(:new).with(args).and_return(indexer) diff --git a/spec/jobs/sitemap_monitor_job_spec.rb b/spec/jobs/sitemap_monitor_job_spec.rb index f4cab87241..719bc499cc 100644 --- a/spec/jobs/sitemap_monitor_job_spec.rb +++ b/spec/jobs/sitemap_monitor_job_spec.rb @@ -4,7 +4,7 @@ let(:searchgov_domain) { instance_double(SearchgovDomain) } subject(:perform) { SitemapMonitorJob.perform_now } - it_behaves_like 'a searchgov job' + it_behaves_like 'a sitemap job' context 'when domains can be indexed' do before do diff --git a/spec/support/sitemap_job_behavior.rb b/spec/support/sitemap_job_behavior.rb new file mode 100644 index 0000000000..002ab1242b --- /dev/null +++ b/spec/support/sitemap_job_behavior.rb @@ -0,0 +1,9 @@ +shared_examples_for 'a sitemap job' do + let(:args) { nil } + + it 'uses the "sitemap" queue' do + expect{ + described_class.perform_later(args) + }.to have_enqueued_job.on_queue('sitemap') + end +end