현재 플러그인과 테마의 두 가지 스켈레톤 모두에 우리가 ‘스모크 스펙(smoke specs)’ 또는 '핵심 기능 스펙(core features specs)'이라 부르는 내용을 추가했습니다.
이 스펙들은 작업 중인 플러그인이나 테마가 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