2022-02-04 00:36:40 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-12-29 07:35:06 -05:00
|
|
|
require "rails_helper"
|
2022-02-04 00:36:40 -05:00
|
|
|
|
|
|
|
RSpec.describe Jobs::RefreshSubscriptionsCampaignData do
|
2022-12-29 07:35:06 -05:00
|
|
|
before { SiteSetting.discourse_subscriptions_campaign_enabled = true }
|
2022-02-04 00:36:40 -05:00
|
|
|
|
2022-12-29 07:35:06 -05:00
|
|
|
it "should execute the job only if stripe is configured" do
|
2022-02-04 00:36:40 -05:00
|
|
|
DiscourseSubscriptions::Campaign.any_instance.expects(:refresh_data).once
|
|
|
|
described_class.new.execute({})
|
|
|
|
|
|
|
|
SiteSetting.discourse_subscriptions_public_key = "PUBLIC_KEY"
|
|
|
|
SiteSetting.discourse_subscriptions_secret_key = "SECRET_KEY"
|
|
|
|
described_class.new.execute({})
|
|
|
|
end
|
|
|
|
end
|