Commits

Anonymous committed 2be43cc

Find visible issues only in ContextMenusController#issues.

Comments (0)

Files changed (2)

app/controllers/context_menus_controller.rb

   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)

test/functional/context_menus_controller_test.rb

                                              :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