summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-03-16 02:47:09 +0000
committerGo MAEDA <maeda@farend.jp>2021-03-16 02:47:09 +0000
commit124c94df94c73250db65090c67af3e780006437b (patch)
treee99d6c3ebb0d735341785c072e56d37518c78e57 /test
parent1accf2a072bfa34b77162c29f42e556b8ec54056 (diff)
downloadredmine-124c94df94c73250db65090c67af3e780006437b.tar.gz
redmine-124c94df94c73250db65090c67af3e780006437b.zip
Only show currently visible projects in the project jump box (#34595).
Patch by Holger Just and Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@20803 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/lib/redmine/project_jump_box_test.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/unit/lib/redmine/project_jump_box_test.rb b/test/unit/lib/redmine/project_jump_box_test.rb
index 5842354c5..e232a1e93 100644
--- a/test/unit/lib/redmine/project_jump_box_test.rb
+++ b/test/unit/lib/redmine/project_jump_box_test.rb
@@ -23,7 +23,8 @@ class Redmine::ProjectJumpBoxTest < ActiveSupport::TestCase
fixtures :users, :projects, :user_preferences
def setup
- @user = User.find_by_login 'dlopper'
+ @user = User.find_by_login 'jsmith'
+ User.current = @user
@ecookbook = Project.find 'ecookbook'
@onlinestore = Project.find 'onlinestore'
end
@@ -134,4 +135,16 @@ class Redmine::ProjectJumpBoxTest < ActiveSupport::TestCase
assert_equal @onlinestore, pjb.recently_used_projects.first
assert_equal @ecookbook, pjb.recently_used_projects.last
end
+
+ def test_recents_list_should_include_only_visible_projects
+ @user = User.find_by_login 'dlopper'
+ User.current = @user
+
+ pjb = Redmine::ProjectJumpBox.new @user
+ pjb.project_used @ecookbook
+ pjb.project_used @onlinestore
+
+ assert_equal 1, pjb.recently_used_projects.size
+ assert_equal @ecookbook, pjb.recently_used_projects.first
+ end
end