summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/auto_completes_controller.rb1
-rw-r--r--test/functional/auto_completes_controller_test.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/auto_completes_controller.rb b/app/controllers/auto_completes_controller.rb
index a3ed88e36..feb1cb231 100644
--- a/app/controllers/auto_completes_controller.rb
+++ b/app/controllers/auto_completes_controller.rb
@@ -11,6 +11,7 @@ class AutoCompletesController < ApplicationController
unless q.blank?
@issues += query.visible.find(:all, :conditions => ["LOWER(#{Issue.table_name}.subject) LIKE ?", "%#{q.downcase}%"], :limit => 10)
end
+ @issues.compact!
render :layout => false
end
diff --git a/test/functional/auto_completes_controller_test.rb b/test/functional/auto_completes_controller_test.rb
index 697436b6e..e5e898b15 100644
--- a/test/functional/auto_completes_controller_test.rb
+++ b/test/functional/auto_completes_controller_test.rb
@@ -29,6 +29,6 @@ class AutoCompletesControllerTest < ActionController::TestCase
Setting.cross_project_issue_relations = '0'
get :issues, :project_id => 'ecookbook', :q => '13', :scope => 'all'
assert_response :success
- assert_equal [nil], assigns(:issues)
+ assert_equal [], assigns(:issues)
end
end