annotate test/integration/.svn/text-base/projects_test.rb.svn-base @ 669:202986dd17e4 live bibliography_plugin_alpha

Merge from branch "cannam_integration"
author Chris Cannam
date Fri, 09 Sep 2011 16:56:21 +0100
parents af80e5618e9b
children
rev   line source
Chris@0 1 # redMine - project management software
Chris@0 2 # Copyright (C) 2006-2007 Jean-Philippe Lang
Chris@0 3 #
Chris@0 4 # This program is free software; you can redistribute it and/or
Chris@0 5 # modify it under the terms of the GNU General Public License
Chris@0 6 # as published by the Free Software Foundation; either version 2
Chris@0 7 # of the License, or (at your option) any later version.
Chris@0 8 #
Chris@0 9 # This program is distributed in the hope that it will be useful,
Chris@0 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@0 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@0 12 # GNU General Public License for more details.
Chris@0 13 #
Chris@0 14 # You should have received a copy of the GNU General Public License
Chris@0 15 # along with this program; if not, write to the Free Software
Chris@0 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Chris@0 17
Chris@117 18 require File.expand_path('../../test_helper', __FILE__)
Chris@0 19
Chris@0 20 class ProjectsTest < ActionController::IntegrationTest
Chris@0 21 fixtures :projects, :users, :members
Chris@0 22
Chris@0 23 def test_archive_project
Chris@0 24 subproject = Project.find(1).children.first
Chris@0 25 log_user("admin", "admin")
Chris@0 26 get "admin/projects"
Chris@0 27 assert_response :success
Chris@0 28 assert_template "admin/projects"
Chris@0 29 post "projects/archive", :id => 1
chris@37 30 assert_redirected_to "/admin/projects"
Chris@0 31 assert !Project.find(1).active?
Chris@0 32
Chris@0 33 get 'projects/1'
Chris@0 34 assert_response 403
Chris@0 35 get "projects/#{subproject.id}"
Chris@0 36 assert_response 403
Chris@0 37
Chris@0 38 post "projects/unarchive", :id => 1
chris@37 39 assert_redirected_to "/admin/projects"
Chris@0 40 assert Project.find(1).active?
Chris@0 41 get "projects/1"
Chris@0 42 assert_response :success
Chris@0 43 end
Chris@0 44 end