Skip to content

Commit

Permalink
add blank api search test
Browse files Browse the repository at this point in the history
  • Loading branch information
mjansing committed Oct 14, 2024
1 parent 2171749 commit 8e88357
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/integration/search_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,14 @@ class SearchTest < ActionDispatch::IntegrationTest
assert page.source.include?('#result2">')
assert !page.source.include?('#result3">') # we're on page 3/3
end

test 'api searching with empty search query' do
%w(ttl nt rdf).each do |format|
get search_url(lang: 'en', format: format)
assert_response :bad_request, 'should return bad request without search query'

get search_url(lang: 'en', format: format, query: '')
assert_response :bad_request, 'should return bad request with blank search query'
end
end
end

0 comments on commit 8e88357

Please sign in to comment.