]> source.dussan.org Git - redmine.git/commitdiff
Find visible issues only in ContextMenusController#issues.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 29 Dec 2010 19:55:52 +0000 (19:55 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 29 Dec 2010 19:55:52 +0000 (19:55 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4580 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/context_menus_controller.rb
test/functional/context_menus_controller_test.rb

index 3e1438306e3eed2532ef23dd05795c0f0471e437..373938abe5edcb9d4bd5957d49f01d4bb2cfa3ca 100644 (file)
@@ -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)
index 9eacdbba8e30547bfdf262196c803f0ea7763d93..7f160881cd79a05489c0777badd76014d24c2605 100644 (file)
@@ -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