Permette di correggere la timeline e ripristina la ricerca in alto.
CI / scan_ruby (push) Failing after 11m33s
CI / scan_js (push) Successful in 11m14s
CI / lint (push) Failing after 11m48s

Le voci si possono modificare o eliminare se registrate per errore, e la ricerca non va più in errore SQL sul campo email.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 23:09:30 +02:00
co-authored by Cursor
parent 4e03fa58ab
commit 34114e8ca8
8 changed files with 162 additions and 6 deletions
@@ -0,0 +1,34 @@
require "test_helper"
class SearchControllerTest < ActionDispatch::IntegrationTest
test "header includes a search form with submit" do
login_as users(:admin)
get organizations_path(project_code: "matchlivetv")
assert_response :success
assert_includes response.body, 'action="/p/matchlivetv/search"'
assert_includes response.body, 'method="get"'
assert_includes response.body, 'name="q"'
assert_includes response.body, 'type="submit"'
end
test "search finds organization by name" do
login_as users(:admin)
get search_path(project_code: "matchlivetv", q: "ASD Test")
assert_response :success
assert_match(/ASD Test Calcio/, response.body)
end
test "search finds contact by last name" do
login_as users(:admin)
get search_path(project_code: "matchlivetv", q: "Rossi")
assert_response :success
assert_match(/Mario Rossi/, response.body)
end
test "empty search does not error" do
login_as users(:admin)
get search_path(project_code: "matchlivetv")
assert_response :success
assert_match(/Nessun risultato/, response.body)
end
end