From 7bc3cf94cbb9ad4ed13dace618db28d2a327e168 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 11 Dec 2014 20:18:30 +0000 Subject: [PATCH] Adds a test for search with limited results. git-svn-id: http://svn.redmine.org/redmine/trunk@13736 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/search_controller_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index 4124985db..1a11e0444 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -238,6 +238,15 @@ class SearchControllerTest < ActionController::TestCase assert results.map(&:event_datetime).min >= '20080806T073000'.to_time end + def test_search_with_limited_results + issues = (0..24).map {|i| Issue.generate!(:subject => 'search_with_limited_results')}.reverse + + get :index, :q => 'limited_results' + assert_response :success + assert_equal 10, assigns(:results).size + assert_equal issues[0..9], assigns(:results) + end + def test_search_with_invalid_project_id get :index, :id => 195, :q => 'recipe' assert_response 404 -- 2.39.5