discourse/spec/jobs/call_discourse_hub_spec.rb
Vinoth Kannan b3238bfc34
FEATURE: call hub API to update Discourse discover enrollment. (#25634)
Now forums can enroll their sites to be showcased in the Discourse [Discover](https://discourse.org/discover) directory. Once they enable the site setting `include_in_discourse_discover` to enroll their forum the `CallDiscourseHub` job will ping the `api.discourse.org/api/discover/enroll` endpoint. Then the Discourse Hub will fetch the basic details from the forum and add it to the review queue. If the site is approved then the forum details will be displayed in the `/discover` page.
2024-02-23 11:42:28 +05:30

17 lines
465 B
Ruby

# frozen_string_literal: true
RSpec.describe Jobs::CallDiscourseHub do
describe "#execute" do
context "when `include_in_discourse_discover setting` enabled" do
it "calls `discover_enrollment` method in DiscourseHub" do
SiteSetting.version_checks = false
SiteSetting.include_in_discourse_discover = true
DiscourseHub.stubs(:discover_enrollment).returns(true)
described_class.new.execute({})
end
end
end
end