لقد قمنا للتو بتضمين ما نسميه مواصفات الدخان أو مواصفات الميزات الأساسية في كلتا الهيكلين لـ الإضافات و القوالب.
تضمن هذه المواصفات أن الإضافة أو القالب الذي تعمل عليه لا يكسر الوظائف الأساسية لـ Discourse.
من السهل إضافة هذه المواصفات إلى إضافة أو قالب موجود:
للإضافة
# 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
لقد صادفتُ هذه المشكلة مؤخرًا. إليك كيفية تعيين الامتدادات المطلوبة:
RSpec.describe "Core features" do
+ SiteSetting.theme_authorized_extensions = "js|css"
before { upload_theme_or_component }
it_behaves_like "having working core features"
end