3 class SearchControllerTest < ActionController::TestCase
4 # These tests don't do state-changing API calls. Save some time by
5 # skipping the database reset.
6 reset_api_fixtures :after_each_test, false
7 reset_api_fixtures :after_suite, true
9 include Rails.application.routes.url_helpers
11 test 'Get search dialog' do
16 action_href: url_for(host: 'localhost', controller: :actions, action: :show),
17 action_data: {}.to_json,
18 }, session_for(:active)
19 assert_response :success
22 test 'Get search results for all projects' do
26 }, session_for(:active)
27 assert_response :success
28 assert_not_empty(json_response['content'],
29 'search results for all projects should not be empty')
32 test 'Get search results for empty project' do
36 project_uuid: api_fixture('groups')['empty_project']['uuid'],
37 }, session_for(:active)
38 assert_response :success
39 assert_empty(json_response['content'],
40 'search results for empty project should be empty')