@@ -42,37 +42,37 @@ class HomeControllerTest < Kaui::FunctionalTestHelper
4242
4343 test 'should understand account search queries' do
4444 dummy_uuid = SecureRandom . uuid . to_s
45- # search by account_id (unique UUID) → redirects directly to account detail
45+ # search defaults using a UUID
4646 get :search , params : { q : query_builder ( 'ACCOUNT' , @account . account_id ) }
47- assert_redirected_to account_path ( @account . account_id )
47+ assert_redirected_to accounts_path ( q : @account . account_id )
4848
49- # search by name ('Kaui' is shared across test accounts) → redirects to list
49+ # search defaults using a String
5050 get :search , params : { q : query_builder ( 'ACCOUNT' , @account . name ) }
5151 assert_redirected_to accounts_path ( q : @account . name )
5252
53- # search by account_id again → redirects directly to account detail
53+ # search by ID
5454 get :search , params : { q : query_builder ( 'ACCOUNT' , @account . account_id ) }
55- assert_redirected_to account_path ( @account . account_id )
55+ assert_redirected_to accounts_path ( q : @account . account_id )
5656
5757 # search by ID and fails
5858 get :search , params : { q : query_builder ( 'ACCOUNT' , dummy_uuid ) }
5959 assert_redirected_to home_path
6060 assert_equal "No account matches \" #{ dummy_uuid } \" " , flash [ :error ]
6161
62- # search by external_key (unique UUID) → redirects directly to account detail
62+ # search by EXTERNAL_KEY
6363 get :search , params : { q : query_builder ( 'ACCOUNT' , @account . external_key ) }
64- assert_redirected_to account_path ( @account . account_id )
64+ assert_redirected_to accounts_path ( q : @account . external_key )
6565
6666 # search by EXTERNAL_KEY and fails
6767 get :search , params : { q : query_builder ( 'ACCOUNT' , dummy_uuid ) }
6868 assert_redirected_to home_path
6969 assert_equal "No account matches \" #{ dummy_uuid } \" " , flash [ :error ]
7070
71- # search by name (shared) → redirects to list
71+ # search by BLANK only first
7272 get :search , params : { q : query_builder ( 'ACCOUNT' , @account . name ) }
7373 assert_redirected_to accounts_path ( q : @account . name )
7474
75- # search by name again (shared) → redirects to list
75+ # search by BLANK
7676 get :search , params : { q : query_builder ( 'ACCOUNT' , @account . name ) }
7777 assert_redirected_to accounts_path ( q : @account . name )
7878
@@ -327,11 +327,9 @@ class HomeControllerTest < Kaui::FunctionalTestHelper
327327 test 'should understand tag search queries' do
328328 dummy_uuid = SecureRandom . uuid . to_s
329329 tag = create_tag
330- # search by tag UUID: Kill Bill tag search doesn't support lookup by tag_id,
331- # so this falls through to an error
330+ # search by ID
332331 get :search , params : { q : query_builder ( 'TAG' , tag [ 0 ] . tag_id ) }
333- assert_redirected_to home_path
334- assert_equal "No tag matches \" #{ tag [ 0 ] . tag_id } \" " , flash [ :error ]
332+ assert_redirected_to tags_path ( q : tag [ 0 ] . tag_id )
335333
336334 # search by ID and fails
337335 get :search , params : { q : query_builder ( 'TAG' , dummy_uuid ) }
0 commit comments