Mercurial > hg > soundsoftware-site
comparison test/integration/routing/issue_categories_test.rb @ 1115:433d4f72a19b redmine-2.2
Update to Redmine SVN revision 11137 on 2.2-stable branch
author | Chris Cannam |
---|---|
date | Mon, 07 Jan 2013 12:01:42 +0000 |
parents | |
children | 622f24f53b42 |
comparison
equal
deleted
inserted
replaced
929:5f33065ddc4b | 1115:433d4f72a19b |
---|---|
1 # Redmine - project management software | |
2 # Copyright (C) 2006-2012 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 RoutingIssueCategoriesTest < ActionController::IntegrationTest | |
21 def test_issue_categories_scoped_under_project | |
22 assert_routing( | |
23 { :method => 'get', :path => "/projects/foo/issue_categories" }, | |
24 { :controller => 'issue_categories', :action => 'index', | |
25 :project_id => 'foo' } | |
26 ) | |
27 assert_routing( | |
28 { :method => 'get', :path => "/projects/foo/issue_categories.xml" }, | |
29 { :controller => 'issue_categories', :action => 'index', | |
30 :project_id => 'foo', :format => 'xml' } | |
31 ) | |
32 assert_routing( | |
33 { :method => 'get', :path => "/projects/foo/issue_categories.json" }, | |
34 { :controller => 'issue_categories', :action => 'index', | |
35 :project_id => 'foo', :format => 'json' } | |
36 ) | |
37 assert_routing( | |
38 { :method => 'get', :path => "/projects/foo/issue_categories/new" }, | |
39 { :controller => 'issue_categories', :action => 'new', | |
40 :project_id => 'foo' } | |
41 ) | |
42 assert_routing( | |
43 { :method => 'post', :path => "/projects/foo/issue_categories" }, | |
44 { :controller => 'issue_categories', :action => 'create', | |
45 :project_id => 'foo' } | |
46 ) | |
47 assert_routing( | |
48 { :method => 'post', :path => "/projects/foo/issue_categories.xml" }, | |
49 { :controller => 'issue_categories', :action => 'create', | |
50 :project_id => 'foo', :format => 'xml' } | |
51 ) | |
52 assert_routing( | |
53 { :method => 'post', :path => "/projects/foo/issue_categories.json" }, | |
54 { :controller => 'issue_categories', :action => 'create', | |
55 :project_id => 'foo', :format => 'json' } | |
56 ) | |
57 end | |
58 | |
59 def test_issue_categories | |
60 assert_routing( | |
61 { :method => 'get', :path => "/issue_categories/1" }, | |
62 { :controller => 'issue_categories', :action => 'show', :id => '1' } | |
63 ) | |
64 assert_routing( | |
65 { :method => 'get', :path => "/issue_categories/1.xml" }, | |
66 { :controller => 'issue_categories', :action => 'show', :id => '1', | |
67 :format => 'xml' } | |
68 ) | |
69 assert_routing( | |
70 { :method => 'get', :path => "/issue_categories/1.json" }, | |
71 { :controller => 'issue_categories', :action => 'show', :id => '1', | |
72 :format => 'json' } | |
73 ) | |
74 assert_routing( | |
75 { :method => 'get', :path => "/issue_categories/1/edit" }, | |
76 { :controller => 'issue_categories', :action => 'edit', :id => '1' } | |
77 ) | |
78 assert_routing( | |
79 { :method => 'put', :path => "/issue_categories/1" }, | |
80 { :controller => 'issue_categories', :action => 'update', :id => '1' } | |
81 ) | |
82 assert_routing( | |
83 { :method => 'put', :path => "/issue_categories/1.xml" }, | |
84 { :controller => 'issue_categories', :action => 'update', :id => '1', | |
85 :format => 'xml' } | |
86 ) | |
87 assert_routing( | |
88 { :method => 'put', :path => "/issue_categories/1.json" }, | |
89 { :controller => 'issue_categories', :action => 'update', :id => '1', | |
90 :format => 'json' } | |
91 ) | |
92 assert_routing( | |
93 { :method => 'delete', :path => "/issue_categories/1" }, | |
94 { :controller => 'issue_categories', :action => 'destroy', :id => '1' } | |
95 ) | |
96 assert_routing( | |
97 { :method => 'delete', :path => "/issue_categories/1.xml" }, | |
98 { :controller => 'issue_categories', :action => 'destroy', :id => '1', | |
99 :format => 'xml' } | |
100 ) | |
101 assert_routing( | |
102 { :method => 'delete', :path => "/issue_categories/1.json" }, | |
103 { :controller => 'issue_categories', :action => 'destroy', :id => '1', | |
104 :format => 'json' } | |
105 ) | |
106 end | |
107 end |