Files
discourse/spec/support/shared_examples/versioned_model.rb
Loïc Guitaut 4f82ceaf39 DEV: Introduce core features system specs for plugins
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
```
2025-03-27 12:12:01 +01:00

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