summaryrefslogtreecommitdiffstats
path: root/test/integration/api_test/projects_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2021-06-24 13:55:06 +0000
committerGo MAEDA <maeda@farend.jp>2021-06-24 13:55:06 +0000
commit890dc20ad749f1f9fa0fca41a2c23bb520be5008 (patch)
treed006c63efe13a46e1254359aa2208f392de860f3 /test/integration/api_test/projects_test.rb
parentf75756e870fb3ae5d0c793032472391bb573c9cd (diff)
downloadredmine-890dc20ad749f1f9fa0fca41a2c23bb520be5008.tar.gz
redmine-890dc20ad749f1f9fa0fca41a2c23bb520be5008.zip
API to archive/unarchive projects (#35420).
Patch by Felix Schäfer. git-svn-id: http://svn.redmine.org/redmine/trunk@21044 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/api_test/projects_test.rb')
-rw-r--r--test/integration/api_test/projects_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/integration/api_test/projects_test.rb b/test/integration/api_test/projects_test.rb
index 59b10efc3..1d8eb17eb 100644
--- a/test/integration/api_test/projects_test.rb
+++ b/test/integration/api_test/projects_test.rb
@@ -356,4 +356,21 @@ class Redmine::ApiTest::ProjectsTest < Redmine::ApiTest::Base
assert_equal '', @response.body
assert_nil Project.find_by_id(2)
end
+
+ test "PUT /projects/:id/archive.xml should archive project" do
+ put '/projects/1/archive.xml', :headers => credentials('admin')
+ assert_response :no_content
+ assert_equal '', @response.body
+ assert p = Project.find(1)
+ assert_not p.active?
+ end
+
+ test "PUT /projects/:id/unarchive.xml should unarchive project" do
+ Project.find(1).update_column :status, Project::STATUS_ARCHIVED
+ put '/projects/1/unarchive.xml', :headers => credentials('admin')
+ assert_response :no_content
+ assert_equal '', @response.body
+ assert p = Project.find_by_id(2)
+ assert p.active?
+ end
end