##// END OF EJS Templates
test: route: move news test to new file...
Toshi MARUYAMA -
r8238:39aabb2b4bab
parent child
Show More
@@ -0,0 +1,86
1 # Redmine - project management software
2 # Copyright (C) 2006-2011 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 RoutingNewsTest < ActionController::IntegrationTest
21 def test_news
22 assert_routing(
23 { :method => 'get', :path => "/news" },
24 { :controller => 'news', :action => 'index' }
25 )
26 assert_routing(
27 { :method => 'get', :path => "/news.atom" },
28 { :controller => 'news', :action => 'index', :format => 'atom' }
29 )
30 assert_routing(
31 { :method => 'get', :path => "/news.xml" },
32 { :controller => 'news', :action => 'index', :format => 'xml' }
33 )
34 assert_routing(
35 { :method => 'get', :path => "/news.json" },
36 { :controller => 'news', :action => 'index', :format => 'json' }
37 )
38 assert_routing(
39 { :method => 'get', :path => "/projects/567/news" },
40 { :controller => 'news', :action => 'index', :project_id => '567' }
41 )
42 assert_routing(
43 { :method => 'get', :path => "/projects/567/news.atom" },
44 { :controller => 'news', :action => 'index', :format => 'atom',
45 :project_id => '567' }
46 )
47 assert_routing(
48 { :method => 'get', :path => "/projects/567/news.xml" },
49 { :controller => 'news', :action => 'index', :format => 'xml',
50 :project_id => '567' }
51 )
52 assert_routing(
53 { :method => 'get', :path => "/projects/567/news.json" },
54 { :controller => 'news', :action => 'index', :format => 'json',
55 :project_id => '567' }
56 )
57 assert_routing(
58 { :method => 'get', :path => "/news/2" },
59 { :controller => 'news', :action => 'show', :id => '2' }
60 )
61 assert_routing(
62 { :method => 'get', :path => "/projects/567/news/new" },
63 { :controller => 'news', :action => 'new', :project_id => '567' }
64 )
65 assert_routing(
66 { :method => 'get', :path => "/news/234" },
67 { :controller => 'news', :action => 'show', :id => '234' }
68 )
69 assert_routing(
70 { :method => 'get', :path => "/news/567/edit" },
71 { :controller => 'news', :action => 'edit', :id => '567' }
72 )
73 assert_routing(
74 { :method => 'post', :path => "/projects/567/news" },
75 { :controller => 'news', :action => 'create', :project_id => '567' }
76 )
77 assert_routing(
78 { :method => 'put', :path => "/news/567" },
79 { :controller => 'news', :action => 'update', :id => '567' }
80 )
81 assert_routing(
82 { :method => 'delete', :path => "/news/567" },
83 { :controller => 'news', :action => 'destroy', :id => '567' }
84 )
85 end
86 end
@@ -18,72 +18,6
18 require File.expand_path('../../test_helper', __FILE__)
18 require File.expand_path('../../test_helper', __FILE__)
19
19
20 class RoutingTest < ActionController::IntegrationTest
20 class RoutingTest < ActionController::IntegrationTest
21 def test_news
22 assert_routing(
23 { :method => 'get', :path => "/news" },
24 { :controller => 'news', :action => 'index' }
25 )
26 assert_routing(
27 { :method => 'get', :path => "/news.atom" },
28 { :controller => 'news', :action => 'index', :format => 'atom' }
29 )
30 assert_routing(
31 { :method => 'get', :path => "/news.xml" },
32 { :controller => 'news', :action => 'index', :format => 'xml' }
33 )
34 assert_routing(
35 { :method => 'get', :path => "/news.json" },
36 { :controller => 'news', :action => 'index', :format => 'json' }
37 )
38 assert_routing(
39 { :method => 'get', :path => "/projects/567/news" },
40 { :controller => 'news', :action => 'index', :project_id => '567' }
41 )
42 assert_routing(
43 { :method => 'get', :path => "/projects/567/news.atom" },
44 { :controller => 'news', :action => 'index', :format => 'atom',
45 :project_id => '567' }
46 )
47 assert_routing(
48 { :method => 'get', :path => "/projects/567/news.xml" },
49 { :controller => 'news', :action => 'index', :format => 'xml',
50 :project_id => '567' }
51 )
52 assert_routing(
53 { :method => 'get', :path => "/projects/567/news.json" },
54 { :controller => 'news', :action => 'index', :format => 'json',
55 :project_id => '567' }
56 )
57 assert_routing(
58 { :method => 'get', :path => "/news/2" },
59 { :controller => 'news', :action => 'show', :id => '2' }
60 )
61 assert_routing(
62 { :method => 'get', :path => "/projects/567/news/new" },
63 { :controller => 'news', :action => 'new', :project_id => '567' }
64 )
65 assert_routing(
66 { :method => 'get', :path => "/news/234" },
67 { :controller => 'news', :action => 'show', :id => '234' }
68 )
69 assert_routing(
70 { :method => 'get', :path => "/news/567/edit" },
71 { :controller => 'news', :action => 'edit', :id => '567' }
72 )
73 assert_routing(
74 { :method => 'post', :path => "/projects/567/news" },
75 { :controller => 'news', :action => 'create', :project_id => '567' }
76 )
77 assert_routing(
78 { :method => 'put', :path => "/news/567" },
79 { :controller => 'news', :action => 'update', :id => '567' }
80 )
81 assert_routing(
82 { :method => 'delete', :path => "/news/567" },
83 { :controller => 'news', :action => 'destroy', :id => '567' }
84 )
85 end
86
87 def test_projects
21 def test_projects
88 assert_routing(
22 assert_routing(
89 { :method => 'get', :path => "/projects" },
23 { :method => 'get', :path => "/projects" },
General Comments 0
You need to be logged in to leave comments. Login now