2011-05-30 00:11:52 +04:00
|
|
|
#-- copyright
|
|
|
|
# ChiliProject is a project management system.
|
2011-05-30 22:52:25 +04:00
|
|
|
#
|
2011-05-30 00:11:52 +04:00
|
|
|
# Copyright (C) 2010-2011 the ChiliProject Team
|
2011-05-30 22:52:25 +04:00
|
|
|
#
|
2007-05-27 21:42:04 +04:00
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2011-05-30 22:52:25 +04:00
|
|
|
#
|
2011-05-30 00:11:52 +04:00
|
|
|
# See doc/COPYRIGHT.rdoc for more details.
|
|
|
|
#++
|
2010-12-13 02:24:34 +03:00
|
|
|
require File.expand_path('../../test_helper', __FILE__)
|
2007-05-27 21:42:04 +04:00
|
|
|
|
|
|
|
class ProjectsTest < ActionController::IntegrationTest
|
|
|
|
fixtures :projects, :users, :members
|
2011-05-30 22:52:25 +04:00
|
|
|
|
2007-05-27 21:42:04 +04:00
|
|
|
def test_archive_project
|
|
|
|
subproject = Project.find(1).children.first
|
|
|
|
log_user("admin", "admin")
|
|
|
|
get "admin/projects"
|
|
|
|
assert_response :success
|
|
|
|
assert_template "admin/projects"
|
|
|
|
post "projects/archive", :id => 1
|
2010-11-14 19:45:32 +03:00
|
|
|
assert_redirected_to "/admin/projects"
|
2007-05-27 21:42:04 +04:00
|
|
|
assert !Project.find(1).active?
|
2011-05-30 22:52:25 +04:00
|
|
|
|
2009-01-26 04:47:51 +03:00
|
|
|
get 'projects/1'
|
2007-08-29 20:52:35 +04:00
|
|
|
assert_response 403
|
2009-01-26 04:47:51 +03:00
|
|
|
get "projects/#{subproject.id}"
|
2007-08-29 20:52:35 +04:00
|
|
|
assert_response 403
|
2011-05-30 22:52:25 +04:00
|
|
|
|
2007-05-27 21:42:04 +04:00
|
|
|
post "projects/unarchive", :id => 1
|
2010-11-14 19:45:32 +03:00
|
|
|
assert_redirected_to "/admin/projects"
|
2007-05-27 21:42:04 +04:00
|
|
|
assert Project.find(1).active?
|
2009-01-26 04:47:51 +03:00
|
|
|
get "projects/1"
|
2007-05-27 21:42:04 +04:00
|
|
|
assert_response :success
|
2011-05-30 22:52:25 +04:00
|
|
|
end
|
2007-05-27 21:42:04 +04:00
|
|
|
end
|