mirror of
https://github.com/discourse/discourse.git
synced 2025-06-08 09:06:56 +08:00

This patch adds a new shared example to be used as a smoke test in plugins and themes. A `skip_examples` argument is available to easily opt-out from a category of tests. Example: ```rb RSpec.describe "Testing core features", type: :system do it_behaves_like "having working core features", skip_examples: %i[search login] end ```
11 lines
250 B
Ruby
11 lines
250 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.shared_examples_for "a versioned model" do
|
|
let(:model) { Fabricate(described_class.to_s.downcase) }
|
|
|
|
it "is versioned" do
|
|
expect(model).to respond_to(:version)
|
|
expect(model.version).to eq(1)
|
|
end
|
|
end
|