comparison .svn/pristine/d0/d009627e726f03a1c296b163bb2546a76eb0de0f.svn-base @ 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 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
18 require File.expand_path('../../../test_helper', __FILE__)
19
20 class RoutingProjectsTest < ActionController::IntegrationTest
21 def test_projects
22 assert_routing(
23 { :method => 'get', :path => "/projects" },
24 { :controller => 'projects', :action => 'index' }
25 )
26 assert_routing(
27 { :method => 'get', :path => "/projects.atom" },
28 { :controller => 'projects', :action => 'index', :format => 'atom' }
29 )
30 assert_routing(
31 { :method => 'get', :path => "/projects.xml" },
32 { :controller => 'projects', :action => 'index', :format => 'xml' }
33 )
34 assert_routing(
35 { :method => 'get', :path => "/projects/new" },
36 { :controller => 'projects', :action => 'new' }
37 )
38 assert_routing(
39 { :method => 'get', :path => "/projects/test" },
40 { :controller => 'projects', :action => 'show', :id => 'test' }
41 )
42 assert_routing(
43 { :method => 'get', :path => "/projects/1.xml" },
44 { :controller => 'projects', :action => 'show', :id => '1',
45 :format => 'xml' }
46 )
47 assert_routing(
48 { :method => 'get', :path => "/projects/4223/settings" },
49 { :controller => 'projects', :action => 'settings', :id => '4223' }
50 )
51 assert_routing(
52 { :method => 'get', :path => "/projects/4223/settings/members" },
53 { :controller => 'projects', :action => 'settings', :id => '4223',
54 :tab => 'members' }
55 )
56 assert_routing(
57 { :method => 'post', :path => "/projects" },
58 { :controller => 'projects', :action => 'create' }
59 )
60 assert_routing(
61 { :method => 'post', :path => "/projects.xml" },
62 { :controller => 'projects', :action => 'create', :format => 'xml' }
63 )
64 assert_routing(
65 { :method => 'post', :path => "/projects/64/archive" },
66 { :controller => 'projects', :action => 'archive', :id => '64' }
67 )
68 assert_routing(
69 { :method => 'post', :path => "/projects/64/unarchive" },
70 { :controller => 'projects', :action => 'unarchive', :id => '64' }
71 )
72 assert_routing(
73 { :method => 'post', :path => "/projects/64/close" },
74 { :controller => 'projects', :action => 'close', :id => '64' }
75 )
76 assert_routing(
77 { :method => 'post', :path => "/projects/64/reopen" },
78 { :controller => 'projects', :action => 'reopen', :id => '64' }
79 )
80 assert_routing(
81 { :method => 'put', :path => "/projects/4223" },
82 { :controller => 'projects', :action => 'update', :id => '4223' }
83 )
84 assert_routing(
85 { :method => 'put', :path => "/projects/1.xml" },
86 { :controller => 'projects', :action => 'update', :id => '1',
87 :format => 'xml' }
88 )
89 assert_routing(
90 { :method => 'delete', :path => "/projects/64" },
91 { :controller => 'projects', :action => 'destroy', :id => '64' }
92 )
93 assert_routing(
94 { :method => 'delete', :path => "/projects/1.xml" },
95 { :controller => 'projects', :action => 'destroy', :id => '1',
96 :format => 'xml' }
97 )
98 end
99 end