Refactor:Use dev_to? to Check for DEV (#12083)

This commit is contained in:
Molly Struve 2020-12-30 15:34:00 -05:00 committed by GitHub
parent b94c95f164
commit f4315489b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View file

@ -13,7 +13,7 @@ class EmailDigest
# Temporary
# @sre:mstruve This is temporary until we have an efficient way to handle this job
# for our large DEV community. Smaller Forems should be able to handle it no problem
if SiteConfig.community_name == "DEV Community"
if SiteConfig.dev_to?
Emails::SendUserDigestWorker.new.perform(user.id)
else
Emails::SendUserDigestWorker.perform_async(user.id)

View file

@ -8,7 +8,7 @@ module Articles
# Temporary
# @sre:mstruve This is temporary until we have an efficient way to handle this job
# for our large DEV community. Smaller Forems should be able to handle it no problem
return if SiteConfig.community_name == "DEV Community"
return if SiteConfig.dev_to?
if FeatureFlag.enabled?(:feeds_import)
::Feeds::ImportArticlesWorker.perform_async

View file

@ -8,7 +8,7 @@ module Emails
# Temporary
# @sre:mstruve This is temporary until we have an efficient way to handle this job
# for our large DEV community. Smaller Forems should be able to handle it no problem
return if SiteConfig.community_name == "DEV Community"
return if SiteConfig.dev_to?
EmailDigest.send_periodic_digest_email
end

View file

@ -10,7 +10,7 @@ RSpec.describe EmailDigest, type: :service do
end
it "performs job inline if community is DEV" do
allow(SiteConfig).to receive(:community_name).and_return("DEV Community")
allow(SiteConfig).to receive(:dev_to?).and_return(true)
user = create(:user, email_digest_periodic: true)
worker = Emails::SendUserDigestWorker.new
allow(worker).to receive(:perform)

View file

@ -36,7 +36,7 @@ RSpec.describe Articles::RssReaderWorker, type: :worker do
end
it "short circuits if it's running on DEV" do
allow(SiteConfig).to receive(:community_name).and_return("DEV Community")
allow(SiteConfig).to receive(:dev_to?).and_return(true)
allow(RssReader).to receive(:get_all_articles)
allow(FeatureFlag).to receive(:enabled?)