@@ -36,6 +36,29 class RoutingNewsTest < ActionController::IntegrationTest | |||||
36 | { :controller => 'news', :action => 'index', :format => 'json' } |
|
36 | { :controller => 'news', :action => 'index', :format => 'json' } | |
37 | ) |
|
37 | ) | |
38 | assert_routing( |
|
38 | assert_routing( | |
|
39 | { :method => 'get', :path => "/news/2" }, | |||
|
40 | { :controller => 'news', :action => 'show', :id => '2' } | |||
|
41 | ) | |||
|
42 | assert_routing( | |||
|
43 | { :method => 'get', :path => "/news/234" }, | |||
|
44 | { :controller => 'news', :action => 'show', :id => '234' } | |||
|
45 | ) | |||
|
46 | assert_routing( | |||
|
47 | { :method => 'get', :path => "/news/567/edit" }, | |||
|
48 | { :controller => 'news', :action => 'edit', :id => '567' } | |||
|
49 | ) | |||
|
50 | assert_routing( | |||
|
51 | { :method => 'put', :path => "/news/567" }, | |||
|
52 | { :controller => 'news', :action => 'update', :id => '567' } | |||
|
53 | ) | |||
|
54 | assert_routing( | |||
|
55 | { :method => 'delete', :path => "/news/567" }, | |||
|
56 | { :controller => 'news', :action => 'destroy', :id => '567' } | |||
|
57 | ) | |||
|
58 | end | |||
|
59 | ||||
|
60 | def test_news_scoped_under_project | |||
|
61 | assert_routing( | |||
39 | { :method => 'get', :path => "/projects/567/news" }, |
|
62 | { :method => 'get', :path => "/projects/567/news" }, | |
40 | { :controller => 'news', :action => 'index', :project_id => '567' } |
|
63 | { :controller => 'news', :action => 'index', :project_id => '567' } | |
41 | ) |
|
64 | ) | |
@@ -55,32 +78,12 class RoutingNewsTest < ActionController::IntegrationTest | |||||
55 | :project_id => '567' } |
|
78 | :project_id => '567' } | |
56 | ) |
|
79 | ) | |
57 | assert_routing( |
|
80 | 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" }, |
|
81 | { :method => 'get', :path => "/projects/567/news/new" }, | |
63 | { :controller => 'news', :action => 'new', :project_id => '567' } |
|
82 | { :controller => 'news', :action => 'new', :project_id => '567' } | |
64 | ) |
|
83 | ) | |
65 | assert_routing( |
|
84 | 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" }, |
|
85 | { :method => 'post', :path => "/projects/567/news" }, | |
75 | { :controller => 'news', :action => 'create', :project_id => '567' } |
|
86 | { :controller => 'news', :action => 'create', :project_id => '567' } | |
76 | ) |
|
87 | ) | |
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 |
|
88 | end | |
86 | end |
|
89 | end |
General Comments 0
You need to be logged in to leave comments.
Login now