diff options
author | Go MAEDA <maeda@farend.jp> | 2019-05-20 22:26:30 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2019-05-20 22:26:30 +0000 |
commit | 29403e710a8d0d83c81387f236082f209f3ba7ed (patch) | |
tree | 5e396ddcc22d5f7f93b75970340e0197a145f825 /test/functional/projects_controller_test.rb | |
parent | da78e654f13b9b13e1584bac91dae9631c12f63e (diff) | |
download | redmine-29403e710a8d0d83c81387f236082f209f3ba7ed.tar.gz redmine-29403e710a8d0d83c81387f236082f209f3ba7ed.zip |
Adds favorites and recently used projects lists to project jump box (#31355).
Patch by Jens Krämer.
git-svn-id: http://svn.redmine.org/redmine/trunk@18181 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/projects_controller_test.rb')
-rw-r--r-- | test/functional/projects_controller_test.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index e1a17059b..508efa202 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -1000,6 +1000,27 @@ class ProjectsControllerTest < Redmine::ControllerTest assert_select_error /Identifier cannot be blank/ end + def test_bookmark_should_create_bookmark + @request.session[:user_id] = 3 + post :bookmark, params: { id: 'ecookbook' } + assert_redirected_to controller: 'projects', action: 'show', id: 'ecookbook' + jb = Redmine::ProjectJumpBox.new(User.find(3)) + assert jb.bookmark?(Project.find('ecookbook')) + refute jb.bookmark?(Project.find('onlinestore')) + end + + def test_bookmark_should_delete_bookmark + @request.session[:user_id] = 3 + jb = Redmine::ProjectJumpBox.new(User.find(3)) + project = Project.find('ecookbook') + jb.bookmark_project project + delete :bookmark, params: { id: 'ecookbook' } + assert_redirected_to controller: 'projects', action: 'show', id: 'ecookbook' + + jb = Redmine::ProjectJumpBox.new(User.find(3)) + refute jb.bookmark?(Project.find('ecookbook')) + end + def test_jump_without_project_id_should_redirect_to_active_tab get :index, :params => { :jump => 'issues' |