summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/projects_controller_test.rb10
-rw-r--r--test/unit/project_test.rb2
2 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index 8a9bbe6d5..7122f89e2 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -296,6 +296,16 @@ class ProjectsControllerTest < ActionController::TestCase
assert_equal Project.find_by_identifier('ecookbook'), assigns(:project)
end
+ def show_archived_project_should_be_denied
+ project = Project.find_by_identifier('ecookbook')
+ project.archive!
+
+ get :show, :id => 'ecookbook'
+ assert_response 403
+ assert_nil assigns(:project)
+ assert_tag :tag => 'p', :content => /archived/
+ end
+
def test_private_subprojects_hidden
get :show, :id => 'ecookbook'
assert_response :success
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index 08b0fb24a..e4927eba1 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -102,6 +102,7 @@ class ProjectTest < ActiveSupport::TestCase
@ecookbook.reload
assert !@ecookbook.active?
+ assert @ecookbook.archived?
assert !user.projects.include?(@ecookbook)
# Subproject are also archived
assert !@ecookbook.children.empty?
@@ -129,6 +130,7 @@ class ProjectTest < ActiveSupport::TestCase
assert @ecookbook.unarchive
@ecookbook.reload
assert @ecookbook.active?
+ assert !@ecookbook.archived?
assert user.projects.include?(@ecookbook)
# Subproject can now be unarchived
@ecookbook_sub1.reload