summaryrefslogtreecommitdiffstats
path: root/test/functional/projects_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2018-12-02 11:23:10 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2018-12-02 11:23:10 +0000
commit3ba51f205df5560ebaf101d0282084d22e1f0a26 (patch)
tree9cadfc2c1f2a229685eee3fef0b02c6f5cb83617 /test/functional/projects_controller_test.rb
parent12d1372ae54b0bfeeef6ce868a7ad153b391706c (diff)
downloadredmine-3ba51f205df5560ebaf101d0282084d22e1f0a26.tar.gz
redmine-3ba51f205df5560ebaf101d0282084d22e1f0a26.zip
Let admins unarchive the project when trying to access an archived project (#29993).
git-svn-id: http://svn.redmine.org/redmine/trunk@17682 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/projects_controller_test.rb')
-rw-r--r--test/functional/projects_controller_test.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index df1da4a28..e5b5eaaf4 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -524,9 +524,9 @@ class ProjectsControllerTest < Redmine::ControllerTest
assert_response :success
end
- def show_archived_project_should_be_denied
+ def test_show_archived_project_should_be_denied
project = Project.find_by_identifier('ecookbook')
- project.archive!
+ project.archive
get :show, :params => {
:id => 'ecookbook'
@@ -536,6 +536,18 @@ class ProjectsControllerTest < Redmine::ControllerTest
assert_not_include project.name, response.body
end
+ def test_show_archived_project_should_show_unarchive_link_to_admins
+ @request.session[:user_id] = 1
+ project = Project.find_by_identifier('ecookbook')
+ project.archive
+
+ get :show, :params => {
+ :id => 'ecookbook'
+ }
+ assert_response 403
+ assert_select 'a', :text => "Unarchive"
+ end
+
def test_show_should_not_show_private_subprojects_that_are_not_visible
get :show, :params => {
:id => 'ecookbook'