prefactor: update search to use published cards
We're about to make a change to assert that draft cards are not added to the search index, and so let's make the intention behind these tests clear first.
This commit is contained in:
@@ -5,10 +5,10 @@ class SearchesControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
setup do
|
||||
@board.update!(all_access: true)
|
||||
@card = @board.cards.create!(title: "Layout is broken", description: "Look at this mess.", creator: @user)
|
||||
@comment_card = @board.cards.create!(title: "Some card", creator: @user)
|
||||
@card = @board.cards.create!(title: "Layout is broken", description: "Look at this mess.", status: "published", creator: @user)
|
||||
@comment_card = @board.cards.create!(title: "Some card", status: "published", creator: @user)
|
||||
@comment_card.comments.create!(body: "overflowing text issue", creator: @user)
|
||||
@comment2_card = @board.cards.create!(title: "Just haggis", description: "More haggis", creator: @user)
|
||||
@comment2_card = @board.cards.create!(title: "Just haggis", description: "More haggis", status: "published", creator: @user)
|
||||
@comment2_card.comments.create!(body: "I love haggis", creator: @user)
|
||||
|
||||
untenanted { sign_in_as @user }
|
||||
@@ -43,7 +43,7 @@ class SearchesControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "search highlights matched terms with proper HTML marks" do
|
||||
@board.cards.create!(title: "Testing search highlighting", creator: @user)
|
||||
@board.cards.create!(title: "Testing search highlighting", status: "published", creator: @user)
|
||||
|
||||
get search_path(q: "highlighting", script_name: "/#{@account.external_account_id}")
|
||||
assert_response :success
|
||||
@@ -52,6 +52,7 @@ class SearchesControllerTest < ActionDispatch::IntegrationTest
|
||||
test "search preserves highlight marks but escapes surrounding HTML" do
|
||||
@board.cards.create!(
|
||||
title: "<b>Bold</b> testing content",
|
||||
status: "published",
|
||||
creator: @user
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user