mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 01:33:45 +08:00
e395e5e002
Followup to e37fb3042d
Some plugins like discourse-ai and discourse-saml do not
nicely change from kebab-case to Title Case (e.g. Ai, Saml),
and anyway this method of getting the plugin name is not
translated either.
Better to use the plugin setting category if it exists,
since that is written by a human and is translated.
38 lines
1.2 KiB
Ruby
38 lines
1.2 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
describe "Admin Plugins List", type: :system, js: true do
|
|
fab!(:current_user) { Fabricate(:admin) }
|
|
|
|
before do
|
|
sign_in(current_user)
|
|
Discourse.stubs(:visible_plugins).returns([spoiler_alert_plugin])
|
|
end
|
|
|
|
let(:spoiler_alert_plugin) do
|
|
path = File.join(Rails.root, "plugins", "spoiler-alert", "plugin.rb")
|
|
Plugin::Instance.parse_from_source(path)
|
|
end
|
|
|
|
it "shows the list of plugins" do
|
|
visit "/admin/plugins"
|
|
|
|
plugin_row =
|
|
find(".admin-plugins-list tr[data-plugin-name=\"spoiler-alert\"] td.admin-plugins-list__row")
|
|
expect(plugin_row).to have_css(
|
|
".admin-plugins-list__name-with-badges .admin-plugins-list__name",
|
|
text: "Spoiler Alert",
|
|
)
|
|
expect(plugin_row).to have_css(
|
|
".admin-plugins-list__author",
|
|
text: I18n.t("admin_js.admin.plugins.author", { author: "Discourse" }),
|
|
)
|
|
expect(plugin_row).to have_css(
|
|
".admin-plugins-list__name-with-badges .admin-plugins-list__name a[href=\"https://meta.discourse.org/t/12650\"]",
|
|
)
|
|
expect(plugin_row).to have_css(
|
|
".admin-plugins-list__about",
|
|
text: spoiler_alert_plugin.metadata.about,
|
|
)
|
|
end
|
|
end
|