comparison test/functional/project_enumerations_controller_test.rb @ 1298:4f746d8966dd redmine_2.3_integration

Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author Chris Cannam
date Fri, 14 Jun 2013 09:28:30 +0100
parents ec1c49528f36 622f24f53b42
children
comparison
equal deleted inserted replaced
1297:0a574315af3e 1298:4f746d8966dd
1 # Redmine - project management software
2 # Copyright (C) 2006-2013 Jean-Philippe Lang
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
1 require File.expand_path('../../test_helper', __FILE__) 18 require File.expand_path('../../test_helper', __FILE__)
2 19
3 class ProjectEnumerationsControllerTest < ActionController::TestCase 20 class ProjectEnumerationsControllerTest < ActionController::TestCase
4 fixtures :projects, :trackers, :issue_statuses, :issues, 21 fixtures :projects, :trackers, :issue_statuses, :issues,
5 :enumerations, :users, :issue_categories, 22 :enumerations, :users, :issue_categories,
6 :projects_trackers, 23 :projects_trackers,
7 :roles, 24 :roles,
8 :member_roles, 25 :member_roles,
9 :members, 26 :members,
10 :enabled_modules, 27 :enabled_modules,
11 :workflows,
12 :custom_fields, :custom_fields_projects, 28 :custom_fields, :custom_fields_projects,
13 :custom_fields_trackers, :custom_values, 29 :custom_fields_trackers, :custom_values,
14 :time_entries 30 :time_entries
15 31
16 self.use_transactional_fixtures = false 32 self.use_transactional_fixtures = false
73 def test_update_will_update_project_specific_activities 89 def test_update_will_update_project_specific_activities
74 @request.session[:user_id] = 2 # manager 90 @request.session[:user_id] = 2 # manager
75 91
76 project_activity = TimeEntryActivity.new({ 92 project_activity = TimeEntryActivity.new({
77 :name => 'Project Specific', 93 :name => 'Project Specific',
78 :parent => TimeEntryActivity.find(:first), 94 :parent => TimeEntryActivity.first,
79 :project => Project.find(1), 95 :project => Project.find(1),
80 :active => true 96 :active => true
81 }) 97 })
82 assert project_activity.save 98 assert project_activity.save
83 project_activity_two = TimeEntryActivity.new({ 99 project_activity_two = TimeEntryActivity.new({
84 :name => 'Project Specific Two', 100 :name => 'Project Specific Two',
85 :parent => TimeEntryActivity.find(:last), 101 :parent => TimeEntryActivity.last,
86 :project => Project.find(1), 102 :project => Project.find(1),
87 :active => true 103 :active => true
88 }) 104 })
89 assert project_activity_two.save 105 assert project_activity_two.save
90 106
154 170
155 def test_destroy 171 def test_destroy
156 @request.session[:user_id] = 2 # manager 172 @request.session[:user_id] = 2 # manager
157 project_activity = TimeEntryActivity.new({ 173 project_activity = TimeEntryActivity.new({
158 :name => 'Project Specific', 174 :name => 'Project Specific',
159 :parent => TimeEntryActivity.find(:first), 175 :parent => TimeEntryActivity.first,
160 :project => Project.find(1), 176 :project => Project.find(1),
161 :active => true 177 :active => true
162 }) 178 })
163 assert project_activity.save 179 assert project_activity.save
164 project_activity_two = TimeEntryActivity.new({ 180 project_activity_two = TimeEntryActivity.new({
165 :name => 'Project Specific Two', 181 :name => 'Project Specific Two',
166 :parent => TimeEntryActivity.find(:last), 182 :parent => TimeEntryActivity.last,
167 :project => Project.find(1), 183 :project => Project.find(1),
168 :active => true 184 :active => true
169 }) 185 })
170 assert project_activity_two.save 186 assert project_activity_two.save
171 187