Add tests for hyphenated string search

Cover the stemmer tokenizing hyphenated input into separate words and
end-to-end search finding cards with hyphenated titles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Fernando Olivares
2026-02-19 16:16:44 -06:00
parent 554182f4b4
commit 3932fce309
2 changed files with 13 additions and 0 deletions
+6
View File
@@ -12,4 +12,10 @@ class Search::StemmerTest < ActiveSupport::TestCase
assert_equal "test run jump walk", result
end
test "stem hyphenated words" do
result = Search::Stemmer.stem("BC3-IOS-1D8B")
assert_equal "bc3 io 1d8b", result
end
end
+7
View File
@@ -35,4 +35,11 @@ class SearchTest < ActiveSupport::TestCase
results = Search::Record.for(user_without_access.account_id).search("anything", user: user_without_access)
assert_empty results
end
test "search for hyphenated strings" do
card = @board.cards.create!(title: "BC3-IOS-1D8B", creator: @user, status: "published")
results = Search::Record.for(@user.account_id).search("BC3-IOS-1D8B", user: @user)
assert results.find { |it| it.card_id == card.id }
end
end