# spec/system/core_features_spec.rb
RSpec.describe "Core features", type: :system do
before { enable_current_plugin }
it_behaves_like "having working core features"
end
对于主题
# spec/system/core_features_spec.rb
RSpec.describe "Core features", type: :system do
before { upload_theme_or_component }
it_behaves_like "having working core features"
end
如果您需要一次更新多个存储库,可以使用我们的 mass-pr 工具提供的脚本。
如果您的插件或主题有意更改 Discourse 的基本功能,则可以跳过核心功能规范中的某些示例:
it_behaves_like "having working core features", skip_examples: %i[login likes]
RSpec.describe "Core features" do
+ SiteSetting.theme_authorized_extensions = "js|css"
before { upload_theme_or_component }
it_behaves_like "having working core features"
end