From 29403e710a8d0d83c81387f236082f209f3ba7ed Mon Sep 17 00:00:00 2001 From: Go MAEDA Date: Mon, 20 May 2019 22:26:30 +0000 Subject: Adds favorites and recently used projects lists to project jump box (#31355). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Jens Krämer. git-svn-id: http://svn.redmine.org/redmine/trunk@18181 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/projects_controller_test.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/functional/projects_controller_test.rb') 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' -- cgit v1.2.3