##// END OF EJS Templates
test: route: move versions test to new file...
Toshi MARUYAMA -
r8219:ceaaf6d3a27a
parent child
Show More
@@ -0,0 +1,109
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 RoutingVersionsTest < ActionController::IntegrationTest
21 def test_versions
22 # /projects/foo/versions is /projects/foo/roadmap
23 assert_routing(
24 { :method => 'get', :path => "/projects/foo/versions.xml" },
25 { :controller => 'versions', :action => 'index',
26 :project_id => 'foo', :format => 'xml' }
27 )
28 assert_routing(
29 { :method => 'get', :path => "/projects/foo/versions.json" },
30 { :controller => 'versions', :action => 'index',
31 :project_id => 'foo', :format => 'json' }
32 )
33 assert_routing(
34 { :method => 'get', :path => "/projects/foo/versions/new" },
35 { :controller => 'versions', :action => 'new',
36 :project_id => 'foo' }
37 )
38 assert_routing(
39 { :method => 'post', :path => "/projects/foo/versions" },
40 { :controller => 'versions', :action => 'create',
41 :project_id => 'foo' }
42 )
43 assert_routing(
44 { :method => 'post', :path => "/projects/foo/versions.xml" },
45 { :controller => 'versions', :action => 'create',
46 :project_id => 'foo', :format => 'xml' }
47 )
48 assert_routing(
49 { :method => 'post', :path => "/projects/foo/versions.json" },
50 { :controller => 'versions', :action => 'create',
51 :project_id => 'foo', :format => 'json' }
52 )
53 assert_routing(
54 { :method => 'get', :path => "/versions/1" },
55 { :controller => 'versions', :action => 'show', :id => '1' }
56 )
57 assert_routing(
58 { :method => 'get', :path => "/versions/1.xml" },
59 { :controller => 'versions', :action => 'show', :id => '1',
60 :format => 'xml' }
61 )
62 assert_routing(
63 { :method => 'get', :path => "/versions/1.json" },
64 { :controller => 'versions', :action => 'show', :id => '1',
65 :format => 'json' }
66 )
67 assert_routing(
68 { :method => 'get', :path => "/versions/1/edit" },
69 { :controller => 'versions', :action => 'edit', :id => '1' }
70 )
71 assert_routing(
72 { :method => 'put', :path => "/versions/1" },
73 { :controller => 'versions', :action => 'update', :id => '1' }
74 )
75 assert_routing(
76 { :method => 'put', :path => "/versions/1.xml" },
77 { :controller => 'versions', :action => 'update', :id => '1',
78 :format => 'xml' }
79 )
80 assert_routing(
81 { :method => 'put', :path => "/versions/1.json" },
82 { :controller => 'versions', :action => 'update', :id => '1',
83 :format => 'json' }
84 )
85 assert_routing(
86 { :method => 'delete', :path => "/versions/1" },
87 { :controller => 'versions', :action => 'destroy', :id => '1' }
88 )
89 assert_routing(
90 { :method => 'delete', :path => "/versions/1.xml" },
91 { :controller => 'versions', :action => 'destroy', :id => '1',
92 :format => 'xml' }
93 )
94 assert_routing(
95 { :method => 'delete', :path => "/versions/1.json" },
96 { :controller => 'versions', :action => 'destroy', :id => '1',
97 :format => 'json' }
98 )
99 assert_routing(
100 { :method => 'put', :path => "/projects/foo/versions/close_completed" },
101 { :controller => 'versions', :action => 'close_completed',
102 :project_id => 'foo' }
103 )
104 assert_routing(
105 { :method => 'post', :path => "/versions/1/status_by" },
106 { :controller => 'versions', :action => 'status_by', :id => '1' }
107 )
108 end
109 end
@@ -867,95 +867,6 class RoutingTest < ActionController::IntegrationTest
867 867 )
868 868 end
869 869
870 def test_versions
871 # /projects/foo/versions is /projects/foo/roadmap
872 assert_routing(
873 { :method => 'get', :path => "/projects/foo/versions.xml" },
874 { :controller => 'versions', :action => 'index',
875 :project_id => 'foo', :format => 'xml' }
876 )
877 assert_routing(
878 { :method => 'get', :path => "/projects/foo/versions.json" },
879 { :controller => 'versions', :action => 'index',
880 :project_id => 'foo', :format => 'json' }
881 )
882 assert_routing(
883 { :method => 'get', :path => "/projects/foo/versions/new" },
884 { :controller => 'versions', :action => 'new',
885 :project_id => 'foo' }
886 )
887 assert_routing(
888 { :method => 'post', :path => "/projects/foo/versions" },
889 { :controller => 'versions', :action => 'create',
890 :project_id => 'foo' }
891 )
892 assert_routing(
893 { :method => 'post', :path => "/projects/foo/versions.xml" },
894 { :controller => 'versions', :action => 'create',
895 :project_id => 'foo', :format => 'xml' }
896 )
897 assert_routing(
898 { :method => 'post', :path => "/projects/foo/versions.json" },
899 { :controller => 'versions', :action => 'create',
900 :project_id => 'foo', :format => 'json' }
901 )
902 assert_routing(
903 { :method => 'get', :path => "/versions/1" },
904 { :controller => 'versions', :action => 'show', :id => '1' }
905 )
906 assert_routing(
907 { :method => 'get', :path => "/versions/1.xml" },
908 { :controller => 'versions', :action => 'show', :id => '1',
909 :format => 'xml' }
910 )
911 assert_routing(
912 { :method => 'get', :path => "/versions/1.json" },
913 { :controller => 'versions', :action => 'show', :id => '1',
914 :format => 'json' }
915 )
916 assert_routing(
917 { :method => 'get', :path => "/versions/1/edit" },
918 { :controller => 'versions', :action => 'edit', :id => '1' }
919 )
920 assert_routing(
921 { :method => 'put', :path => "/versions/1" },
922 { :controller => 'versions', :action => 'update', :id => '1' }
923 )
924 assert_routing(
925 { :method => 'put', :path => "/versions/1.xml" },
926 { :controller => 'versions', :action => 'update', :id => '1',
927 :format => 'xml' }
928 )
929 assert_routing(
930 { :method => 'put', :path => "/versions/1.json" },
931 { :controller => 'versions', :action => 'update', :id => '1',
932 :format => 'json' }
933 )
934 assert_routing(
935 { :method => 'delete', :path => "/versions/1" },
936 { :controller => 'versions', :action => 'destroy', :id => '1' }
937 )
938 assert_routing(
939 { :method => 'delete', :path => "/versions/1.xml" },
940 { :controller => 'versions', :action => 'destroy', :id => '1',
941 :format => 'xml' }
942 )
943 assert_routing(
944 { :method => 'delete', :path => "/versions/1.json" },
945 { :controller => 'versions', :action => 'destroy', :id => '1',
946 :format => 'json' }
947 )
948 assert_routing(
949 { :method => 'put', :path => "/projects/foo/versions/close_completed" },
950 { :controller => 'versions', :action => 'close_completed',
951 :project_id => 'foo' }
952 )
953 assert_routing(
954 { :method => 'post', :path => "/versions/1/status_by" },
955 { :controller => 'versions', :action => 'status_by', :id => '1' }
956 )
957 end
958
959 870 def test_welcome
960 871 assert_routing(
961 872 { :method => 'get', :path => "/robots.txt" },
General Comments 0
You need to be logged in to leave comments. Login now