Files
eminuxCRM/test/controllers/search_controller_test.rb
T
eminuxandCursor 34114e8ca8
CI / scan_ruby (push) Failing after 11m33s
CI / scan_js (push) Successful in 11m14s
CI / lint (push) Failing after 11m48s
Permette di correggere la timeline e ripristina la ricerca in alto.
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>
2026-08-18 23:09:30 +02:00

35 lines
1.1 KiB
Ruby

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