Skip to content

DEV: Try fixing flakey spec #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions spec/system/docs_index_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

describe "Discourse Docs | Index", type: :system do
fab!(:current_user) { Fabricate(:user) }
fab!(:category)
fab!(:topic_1) { Fabricate(:topic, category: category) }
fab!(:topic_2) { Fabricate(:topic, category: category) }
Expand All @@ -11,7 +10,6 @@
before do
SiteSetting.docs_enabled = true
SiteSetting.docs_categories = category.id.to_s
sign_in(current_user)
end

it "does not error when showing the index" do
Expand All @@ -26,9 +24,12 @@
topic_2.update_excerpt(post_2.excerpt_for_topic)
end

it "does not show the topic excerpts by default" do
visit("/docs")
expect(page).to have_no_css(".topic-excerpt")
context "when docs_show_topic_excerpts is false" do
before { SiteSetting.always_include_topic_excerpts = false }
it "does not show the topic excerpts by default" do
visit("/docs")
expect(page).to have_no_css(".topic-excerpt")
end
end

context "when docs_show_topic_excerpts is true" do
Expand Down