summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/context_menus_controller.rb3
-rw-r--r--test/functional/context_menus_controller_test.rb6
2 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/context_menus_controller.rb b/app/controllers/context_menus_controller.rb
index 3e1438306..373938abe 100644
--- a/app/controllers/context_menus_controller.rb
+++ b/app/controllers/context_menus_controller.rb
@@ -2,7 +2,8 @@ class ContextMenusController < ApplicationController
helper :watchers
def issues
- @issues = Issue.find_all_by_id(params[:ids], :include => :project)
+ @issues = Issue.visible.all(:conditions => {:id => params[:ids]}, :include => :project)
+
if (@issues.size == 1)
@issue = @issues.first
@allowed_statuses = @issue.new_statuses_allowed_to(User.current)
diff --git a/test/functional/context_menus_controller_test.rb b/test/functional/context_menus_controller_test.rb
index 9eacdbba8..7f160881c 100644
--- a/test/functional/context_menus_controller_test.rb
+++ b/test/functional/context_menus_controller_test.rb
@@ -102,4 +102,10 @@ class ContextMenusControllerTest < ActionController::TestCase
:class => 'icon-del' }
end
+ def test_context_menu_issue_visibility
+ get :issues, :ids => [1, 4]
+ assert_response :success
+ assert_template 'context_menu'
+ assert_equal [1], assigns(:issues).collect(&:id)
+ end
end