DEV: Core feature spec refinement (#106)

Followup e4b99976eb

This allows us to skip core feature specs more granularly,
since the topic ones work fine except create for example.

Also adds a topic create spec, since this theme uses the sidebar
new topic button component. We can rely on the /new-topic route
instead.
This commit is contained in:
Martin Brennan
2025-04-03 13:40:27 +10:00
committed by GitHub
parent c9c468c677
commit 00b2402cbb
+17 -1
View File
@@ -1,6 +1,22 @@
# frozen_string_literal: true
RSpec.describe "Core features", type: :system do
fab!(:current_user) { Fabricate(:user, refresh_auto_groups: true) }
let(:composer) { PageObjects::Components::Composer.new }
before { upload_theme }
it_behaves_like "having working core features", skip_examples: %i[topics search]
it_behaves_like "having working core features",
skip_examples: %i[topics:create search:quick_search]
it "creates a new topic" do
sign_in(current_user)
visit("/new-topic")
composer.fill_title("This is a new topic")
composer.fill_content("This is a long enough sentence.")
expect(page).to have_css(".d-editor-preview p", visible: true)
within(".save-or-cancel") { click_button("Create Topic") }
expect(page).to have_content("This is a new topic")
expect(page).to have_content("This is a long enough sentence.")
end
end