Rewrote projects archive integration test into cuke

pull/469/head
Sebastian Schuster 11 years ago
parent 9d72eb9488
commit 12db97de8c
  1. 59
      features/projects/archive.feature
  2. 3
      features/support/paths.rb
  3. 55
      test/integration/projects_test.rb

@ -0,0 +1,59 @@
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2013 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See doc/COPYRIGHT.rdoc for more details.
#++
Feature: Navigating to reports page
Background:
Given there is 1 project with the following:
| name | ParentProject |
| identifier | parent_project_1 |
And the project "ParentProject" has 1 subproject with the following:
| name | SubProject |
| identifier | parent_project_1_sub_1 |
@javascript
Scenario: Archiving and unarchiving a project with a subproject
Given I am already admin
When I go to the projects page
Then I should be on the projects page
And I should see "Projects"
And I click on "Archive" within "tr.odd"
And I confirm popups
Then I should be on the projects page
And I should not see "ParentProject"
And I should not see "SubProject"
When I go to the page of the project called "ParentProject"
Then I should see "403"
When I go to the page of the project called "SubProject"
Then I should see "403"
When I go to the projects page
When I select "all" from "status"
And I click on "Unarchive" within "tr.odd"
Then I should be on the projects page
And I should see "ParentProject"
When I go to the page of the project called "ParentProject"
Then I should see "ParentProject"

@ -265,6 +265,9 @@ module NavigationHelpers
when /^the enumerations page$/
'/admin/enumerations'
when /^the projects page$/
'/admin/projects'
when /^the authentication modes page$/
'/auth_sources'

@ -1,55 +0,0 @@
#-- encoding: UTF-8
#-- copyright
# OpenProject is a project management system.
# Copyright (C) 2012-2013 the OpenProject Foundation (OPF)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# 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.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See doc/COPYRIGHT.rdoc for more details.
#++
require File.expand_path('../../test_helper', __FILE__)
class ProjectsTest < ActionDispatch::IntegrationTest
fixtures :all
def test_archive_project
subproject = Project.find(1).children.first
log_user("admin", "adminADMIN!")
get "admin/projects"
assert_response :success
assert_template "admin/projects"
post "projects/archive", :id => 1
assert_redirected_to "/admin/projects"
assert !Project.find(1).active?
get 'projects/1'
assert_response 403
get "projects/#{subproject.id}"
assert_response 403
post "projects/unarchive", :id => 1
assert_redirected_to "/admin/projects"
assert Project.find(1).active?
get "projects/1"
assert_response :success
end
end
Loading…
Cancel
Save