mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 05:59:39 +08:00
DEV: include more data in Discourse Discover enrollment payload. (#25846)
Adding forum's URL, title, and locale to the payload of enrollment can be helpful while managing it in the Discourse Discover.
This commit is contained in:
parent
23bce774d7
commit
1bd9ca11e7
|
@ -15,7 +15,12 @@ module DiscourseHub
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.discover_enrollment_payload
|
def self.discover_enrollment_payload
|
||||||
{ include_in_discourse_discover: SiteSetting.include_in_discourse_discover? }
|
{
|
||||||
|
include_in_discourse_discover: SiteSetting.include_in_discourse_discover?,
|
||||||
|
forum_url: Discourse.base_url,
|
||||||
|
forum_title: SiteSetting.title,
|
||||||
|
locale: I18n.locale,
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.discover_enrollment
|
def self.discover_enrollment
|
||||||
|
|
|
@ -33,6 +33,15 @@ RSpec.describe DiscourseHub do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe ".discover_enrollment_payload" do
|
||||||
|
it "should return the correct payload" do
|
||||||
|
payload = DiscourseHub.discover_enrollment_payload
|
||||||
|
expect(payload[:forum_url]).to eq(Discourse.base_url)
|
||||||
|
expect(payload[:forum_title]).to eq(SiteSetting.title)
|
||||||
|
expect(payload[:locale]).to eq(I18n.locale)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe ".version_check_payload" do
|
describe ".version_check_payload" do
|
||||||
describe "when Discourse Hub has not fetched stats since past 7 days" do
|
describe "when Discourse Hub has not fetched stats since past 7 days" do
|
||||||
it "should include stats" do
|
it "should include stats" do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user