loic
(Loïc Guitaut)
2025 年 4 月 11 日午前 8:43
1
plugins および themes の両方のスケルトンに、スモークスペック、つまりコア機能スペックと呼ばれるものを追加しました。
これらのスペックは、作業中のプラグインまたはテーマが 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
一度に多くのリポジトリを更新する必要がある場合は、mass-pr ツールのスクリプトが利用可能です 。
作業中のプラグインまたはテーマが意図的に Discourse の基本的な機能を変更している場合は、コア機能スペックの一部の例をスキップできます。
it_behaves_like "having working core features", skip_examples: %i[login likes]
以下は、例をスキップするためのキーワードの完全なリストです。
login
likes
profile
topics
topics:read
topics:reply
topics:create
search
search:quick_search
search:full_page
「いいね!」 10
gormus
(Osman Görmüş)
2025 年 5 月 21 日午後 1:51
2
loic:
プラグインやテーマが意図的にDiscourseの基本的な機能を変更する場合、コア機能の仕様からいくつかの例をスキップすることが可能です。
it_behaves_like "having working core features", skip_examples: %i[login likes]
以下は、例をスキップするためのキーワードの完全なリストです。
login
likes
profile
topics
topics:read
topics:reply
topics:create
search
search:quick_search
search:full_page
IMHO、これは非常に便利で役立つでしょう。以下に含めることをお勧めします。
# frozen_string_literal: true
# Parts of the core features examples can be skipped like so:
# it_behaves_like "having working core features", skip_examples: %i[login likes]
#
# List of keywords for skipping examples:
# login, likes, profile, topics, topics:read, topics:reply, topics:create,
および
…または、このトピックのリンク
「いいね!」 2
loic
(Loïc Guitaut)
2025 年 5 月 22 日午後 4:00
3
「いいね!」 1
pfaffman
(Jay Pfaffman)
2025 年 5 月 23 日午後 7:20
4
テーマに異なる Theme authorized extensions を必要とする場合、すべてのテストが失敗します。なぜなら、テーマがロードできないからです。