##// END OF EJS Templates
Refactor: convert the Projects routes to resources....
Eric Davis -
r3957:8d52608dbad6
parent child
Show More
@@ -1,46 +1,46
1 <div class="contextual">
1 <div class="contextual">
2 <%= link_to l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add' %>
2 <%= link_to l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add' %>
3 </div>
3 </div>
4
4
5 <h2><%=l(:label_project_plural)%></h2>
5 <h2><%=l(:label_project_plural)%></h2>
6
6
7 <% form_tag({}, :method => :get) do %>
7 <% form_tag({}, :method => :get) do %>
8 <fieldset><legend><%= l(:label_filter_plural) %></legend>
8 <fieldset><legend><%= l(:label_filter_plural) %></legend>
9 <label><%= l(:field_status) %> :</label>
9 <label><%= l(:field_status) %> :</label>
10 <%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
10 <%= select_tag 'status', project_status_options_for_select(@status), :class => "small", :onchange => "this.form.submit(); return false;" %>
11 <label><%= l(:label_project) %>:</label>
11 <label><%= l(:label_project) %>:</label>
12 <%= text_field_tag 'name', params[:name], :size => 30 %>
12 <%= text_field_tag 'name', params[:name], :size => 30 %>
13 <%= submit_tag l(:button_apply), :class => "small", :name => nil %>
13 <%= submit_tag l(:button_apply), :class => "small", :name => nil %>
14 </fieldset>
14 </fieldset>
15 <% end %>
15 <% end %>
16 &nbsp;
16 &nbsp;
17
17
18 <div class="autoscroll">
18 <div class="autoscroll">
19 <table class="list">
19 <table class="list">
20 <thead><tr>
20 <thead><tr>
21 <th><%=l(:label_project)%></th>
21 <th><%=l(:label_project)%></th>
22 <th><%=l(:field_description)%></th>
22 <th><%=l(:field_description)%></th>
23 <th><%=l(:field_is_public)%></th>
23 <th><%=l(:field_is_public)%></th>
24 <th><%=l(:field_created_on)%></th>
24 <th><%=l(:field_created_on)%></th>
25 <th></th>
25 <th></th>
26 </tr></thead>
26 </tr></thead>
27 <tbody>
27 <tbody>
28 <% project_tree(@projects) do |project, level| %>
28 <% project_tree(@projects) do |project, level| %>
29 <tr class="<%= cycle("odd", "even") %> <%= css_project_classes(project) %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
29 <tr class="<%= cycle("odd", "even") %> <%= css_project_classes(project) %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
30 <td class="name"><%= link_to_project(project, :action => 'settings') %></td>
30 <td class="name"><%= link_to_project(project, :action => 'settings') %></td>
31 <td><%= textilizable project.short_description, :project => project %></td>
31 <td><%= textilizable project.short_description, :project => project %></td>
32 <td align="center"><%= checked_image project.is_public? %></td>
32 <td align="center"><%= checked_image project.is_public? %></td>
33 <td align="center"><%= format_date(project.created_on) %></td>
33 <td align="center"><%= format_date(project.created_on) %></td>
34 <td class="buttons">
34 <td class="buttons">
35 <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-lock') if project.active? %>
35 <%= link_to(l(:button_archive), { :controller => 'projects', :action => 'archive', :id => project, :status => params[:status] }, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-lock') if project.active? %>
36 <%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if !project.active? && (project.parent.nil? || project.parent.active?) %>
36 <%= link_to(l(:button_unarchive), { :controller => 'projects', :action => 'unarchive', :id => project, :status => params[:status] }, :method => :post, :class => 'icon icon-unlock') if !project.active? && (project.parent.nil? || project.parent.active?) %>
37 <%= link_to(l(:button_copy), { :controller => 'projects', :action => 'copy', :id => project }, :class => 'icon icon-copy') %>
37 <%= link_to(l(:button_copy), { :controller => 'projects', :action => 'copy', :id => project }, :class => 'icon icon-copy') %>
38 <%= link_to(l(:button_delete), { :controller => 'projects', :action => 'destroy', :id => project }, :class => 'icon icon-del') %>
38 <%= link_to(l(:button_delete), project_destroy_confirm_path(project), :class => 'icon icon-del') %>
39 </td>
39 </td>
40 </tr>
40 </tr>
41 <% end %>
41 <% end %>
42 </tbody>
42 </tbody>
43 </table>
43 </table>
44 </div>
44 </div>
45
45
46 <% html_title(l(:label_project_plural)) -%>
46 <% html_title(l(:label_project_plural)) -%>
@@ -1,4 +1,4
1 <% labelled_tabular_form_for :project, @project, :url => { :action => "update", :id => @project } do |f| %>
1 <% labelled_tabular_form_for :project, @project, :url => project_path(@project), :html => {:method => (@project.new_record? ? :post : :put) } do |f| %>
2 <%= render :partial => 'form', :locals => { :f => f } %>
2 <%= render :partial => 'form', :locals => { :f => f } %>
3 <%= submit_tag l(:button_save) %>
3 <%= submit_tag l(:button_save) %>
4 <% end %>
4 <% end %>
@@ -1,16 +1,16
1 <h2><%=l(:label_confirmation)%></h2>
1 <h2><%=l(:label_confirmation)%></h2>
2 <div class="warning">
2 <div class="warning">
3 <p><strong><%=h @project_to_destroy %></strong><br />
3 <p><strong><%=h @project_to_destroy %></strong><br />
4 <%=l(:text_project_destroy_confirmation)%>
4 <%=l(:text_project_destroy_confirmation)%>
5
5
6 <% if @project_to_destroy.descendants.any? %>
6 <% if @project_to_destroy.descendants.any? %>
7 <br /><%= l(:text_subprojects_destroy_warning, content_tag('strong', h(@project_to_destroy.descendants.collect{|p| p.to_s}.join(', ')))) %>
7 <br /><%= l(:text_subprojects_destroy_warning, content_tag('strong', h(@project_to_destroy.descendants.collect{|p| p.to_s}.join(', ')))) %>
8 <% end %>
8 <% end %>
9 </p>
9 </p>
10 <p>
10 <p>
11 <% form_tag({:controller => 'projects', :action => 'destroy', :id => @project_to_destroy}) do %>
11 <% form_tag(project_path(@project_to_destroy), :method => :delete) do %>
12 <label><%= check_box_tag 'confirm', 1 %> <%= l(:general_text_Yes) %></label>
12 <label><%= check_box_tag 'confirm', 1 %> <%= l(:general_text_Yes) %></label>
13 <%= submit_tag l(:button_delete) %>
13 <%= submit_tag l(:button_delete) %>
14 <% end %>
14 <% end %>
15 </p>
15 </p>
16 </div>
16 </div>
@@ -1,284 +1,281
1 ActionController::Routing::Routes.draw do |map|
1 ActionController::Routing::Routes.draw do |map|
2 # Add your own custom routes here.
2 # Add your own custom routes here.
3 # The priority is based upon order of creation: first created -> highest priority.
3 # The priority is based upon order of creation: first created -> highest priority.
4
4
5 # Here's a sample route:
5 # Here's a sample route:
6 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
6 # map.connect 'products/:id', :controller => 'catalog', :action => 'view'
7 # Keep in mind you can assign values other than :controller and :action
7 # Keep in mind you can assign values other than :controller and :action
8
8
9 map.home '', :controller => 'welcome'
9 map.home '', :controller => 'welcome'
10
10
11 map.signin 'login', :controller => 'account', :action => 'login'
11 map.signin 'login', :controller => 'account', :action => 'login'
12 map.signout 'logout', :controller => 'account', :action => 'logout'
12 map.signout 'logout', :controller => 'account', :action => 'logout'
13
13
14 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
14 map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow'
15 map.connect 'help/:ctrl/:page', :controller => 'help'
15 map.connect 'help/:ctrl/:page', :controller => 'help'
16
16
17 map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog'
17 map.connect 'time_entries/:id/edit', :action => 'edit', :controller => 'timelog'
18 map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog'
18 map.connect 'projects/:project_id/time_entries/new', :action => 'edit', :controller => 'timelog'
19 map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog'
19 map.connect 'projects/:project_id/issues/:issue_id/time_entries/new', :action => 'edit', :controller => 'timelog'
20
20
21 map.with_options :controller => 'timelog' do |timelog|
21 map.with_options :controller => 'timelog' do |timelog|
22 timelog.connect 'projects/:project_id/time_entries', :action => 'details'
22 timelog.connect 'projects/:project_id/time_entries', :action => 'details'
23
23
24 timelog.with_options :action => 'details', :conditions => {:method => :get} do |time_details|
24 timelog.with_options :action => 'details', :conditions => {:method => :get} do |time_details|
25 time_details.connect 'time_entries'
25 time_details.connect 'time_entries'
26 time_details.connect 'time_entries.:format'
26 time_details.connect 'time_entries.:format'
27 time_details.connect 'issues/:issue_id/time_entries'
27 time_details.connect 'issues/:issue_id/time_entries'
28 time_details.connect 'issues/:issue_id/time_entries.:format'
28 time_details.connect 'issues/:issue_id/time_entries.:format'
29 time_details.connect 'projects/:project_id/time_entries.:format'
29 time_details.connect 'projects/:project_id/time_entries.:format'
30 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries'
30 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries'
31 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries.:format'
31 time_details.connect 'projects/:project_id/issues/:issue_id/time_entries.:format'
32 end
32 end
33 timelog.connect 'projects/:project_id/time_entries/report', :action => 'report'
33 timelog.connect 'projects/:project_id/time_entries/report', :action => 'report'
34 timelog.with_options :action => 'report',:conditions => {:method => :get} do |time_report|
34 timelog.with_options :action => 'report',:conditions => {:method => :get} do |time_report|
35 time_report.connect 'time_entries/report'
35 time_report.connect 'time_entries/report'
36 time_report.connect 'time_entries/report.:format'
36 time_report.connect 'time_entries/report.:format'
37 time_report.connect 'projects/:project_id/time_entries/report.:format'
37 time_report.connect 'projects/:project_id/time_entries/report.:format'
38 end
38 end
39
39
40 timelog.with_options :action => 'edit', :conditions => {:method => :get} do |time_edit|
40 timelog.with_options :action => 'edit', :conditions => {:method => :get} do |time_edit|
41 time_edit.connect 'issues/:issue_id/time_entries/new'
41 time_edit.connect 'issues/:issue_id/time_entries/new'
42 end
42 end
43
43
44 timelog.connect 'time_entries/:id/destroy', :action => 'destroy', :conditions => {:method => :post}
44 timelog.connect 'time_entries/:id/destroy', :action => 'destroy', :conditions => {:method => :post}
45 end
45 end
46
46
47 map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post}
47 map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post}
48 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get}
48 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get}
49 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post}
49 map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post}
50 map.with_options :controller => 'wiki' do |wiki_routes|
50 map.with_options :controller => 'wiki' do |wiki_routes|
51 wiki_routes.with_options :conditions => {:method => :get} do |wiki_views|
51 wiki_routes.with_options :conditions => {:method => :get} do |wiki_views|
52 wiki_views.connect 'projects/:id/wiki/:page', :action => 'special', :page => /page_index|date_index|export/i
52 wiki_views.connect 'projects/:id/wiki/:page', :action => 'special', :page => /page_index|date_index|export/i
53 wiki_views.connect 'projects/:id/wiki/:page', :action => 'index', :page => nil
53 wiki_views.connect 'projects/:id/wiki/:page', :action => 'index', :page => nil
54 wiki_views.connect 'projects/:id/wiki/:page/edit', :action => 'edit'
54 wiki_views.connect 'projects/:id/wiki/:page/edit', :action => 'edit'
55 wiki_views.connect 'projects/:id/wiki/:page/rename', :action => 'rename'
55 wiki_views.connect 'projects/:id/wiki/:page/rename', :action => 'rename'
56 wiki_views.connect 'projects/:id/wiki/:page/history', :action => 'history'
56 wiki_views.connect 'projects/:id/wiki/:page/history', :action => 'history'
57 wiki_views.connect 'projects/:id/wiki/:page/diff/:version/vs/:version_from', :action => 'diff'
57 wiki_views.connect 'projects/:id/wiki/:page/diff/:version/vs/:version_from', :action => 'diff'
58 wiki_views.connect 'projects/:id/wiki/:page/annotate/:version', :action => 'annotate'
58 wiki_views.connect 'projects/:id/wiki/:page/annotate/:version', :action => 'annotate'
59 end
59 end
60
60
61 wiki_routes.connect 'projects/:id/wiki/:page/:action',
61 wiki_routes.connect 'projects/:id/wiki/:page/:action',
62 :action => /edit|rename|destroy|preview|protect/,
62 :action => /edit|rename|destroy|preview|protect/,
63 :conditions => {:method => :post}
63 :conditions => {:method => :post}
64 end
64 end
65
65
66 map.with_options :controller => 'messages' do |messages_routes|
66 map.with_options :controller => 'messages' do |messages_routes|
67 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
67 messages_routes.with_options :conditions => {:method => :get} do |messages_views|
68 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
68 messages_views.connect 'boards/:board_id/topics/new', :action => 'new'
69 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
69 messages_views.connect 'boards/:board_id/topics/:id', :action => 'show'
70 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
70 messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit'
71 end
71 end
72 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
72 messages_routes.with_options :conditions => {:method => :post} do |messages_actions|
73 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
73 messages_actions.connect 'boards/:board_id/topics/new', :action => 'new'
74 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
74 messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply'
75 messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/
75 messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/
76 end
76 end
77 end
77 end
78
78
79 map.with_options :controller => 'boards' do |board_routes|
79 map.with_options :controller => 'boards' do |board_routes|
80 board_routes.with_options :conditions => {:method => :get} do |board_views|
80 board_routes.with_options :conditions => {:method => :get} do |board_views|
81 board_views.connect 'projects/:project_id/boards', :action => 'index'
81 board_views.connect 'projects/:project_id/boards', :action => 'index'
82 board_views.connect 'projects/:project_id/boards/new', :action => 'new'
82 board_views.connect 'projects/:project_id/boards/new', :action => 'new'
83 board_views.connect 'projects/:project_id/boards/:id', :action => 'show'
83 board_views.connect 'projects/:project_id/boards/:id', :action => 'show'
84 board_views.connect 'projects/:project_id/boards/:id.:format', :action => 'show'
84 board_views.connect 'projects/:project_id/boards/:id.:format', :action => 'show'
85 board_views.connect 'projects/:project_id/boards/:id/edit', :action => 'edit'
85 board_views.connect 'projects/:project_id/boards/:id/edit', :action => 'edit'
86 end
86 end
87 board_routes.with_options :conditions => {:method => :post} do |board_actions|
87 board_routes.with_options :conditions => {:method => :post} do |board_actions|
88 board_actions.connect 'projects/:project_id/boards', :action => 'new'
88 board_actions.connect 'projects/:project_id/boards', :action => 'new'
89 board_actions.connect 'projects/:project_id/boards/:id/:action', :action => /edit|destroy/
89 board_actions.connect 'projects/:project_id/boards/:id/:action', :action => /edit|destroy/
90 end
90 end
91 end
91 end
92
92
93 map.with_options :controller => 'documents' do |document_routes|
93 map.with_options :controller => 'documents' do |document_routes|
94 document_routes.with_options :conditions => {:method => :get} do |document_views|
94 document_routes.with_options :conditions => {:method => :get} do |document_views|
95 document_views.connect 'projects/:project_id/documents', :action => 'index'
95 document_views.connect 'projects/:project_id/documents', :action => 'index'
96 document_views.connect 'projects/:project_id/documents/new', :action => 'new'
96 document_views.connect 'projects/:project_id/documents/new', :action => 'new'
97 document_views.connect 'documents/:id', :action => 'show'
97 document_views.connect 'documents/:id', :action => 'show'
98 document_views.connect 'documents/:id/edit', :action => 'edit'
98 document_views.connect 'documents/:id/edit', :action => 'edit'
99 end
99 end
100 document_routes.with_options :conditions => {:method => :post} do |document_actions|
100 document_routes.with_options :conditions => {:method => :post} do |document_actions|
101 document_actions.connect 'projects/:project_id/documents', :action => 'new'
101 document_actions.connect 'projects/:project_id/documents', :action => 'new'
102 document_actions.connect 'documents/:id/:action', :action => /destroy|edit/
102 document_actions.connect 'documents/:id/:action', :action => /destroy|edit/
103 end
103 end
104 end
104 end
105
105
106 map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move'
106 map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move'
107
107
108 # Misc issue routes. TODO: move into resources
108 # Misc issue routes. TODO: move into resources
109 map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues'
109 map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues'
110 map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview
110 map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview
111 map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues'
111 map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues'
112 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
112 map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index'
113 map.bulk_edit_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_edit', :conditions => { :method => :get }
113 map.bulk_edit_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_edit', :conditions => { :method => :get }
114 map.bulk_update_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_update', :conditions => { :method => :post }
114 map.bulk_update_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_update', :conditions => { :method => :post }
115 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post }
115 map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post }
116 map.connect '/issues/:id/destroy', :controller => 'issues', :action => 'destroy', :conditions => { :method => :post } # legacy
116 map.connect '/issues/:id/destroy', :controller => 'issues', :action => 'destroy', :conditions => { :method => :post } # legacy
117
117
118 map.resource :gantt, :path_prefix => '/issues', :controller => 'gantts', :only => [:show, :update]
118 map.resource :gantt, :path_prefix => '/issues', :controller => 'gantts', :only => [:show, :update]
119 map.resource :gantt, :path_prefix => '/projects/:project_id/issues', :controller => 'gantts', :only => [:show, :update]
119 map.resource :gantt, :path_prefix => '/projects/:project_id/issues', :controller => 'gantts', :only => [:show, :update]
120 map.resource :calendar, :path_prefix => '/issues', :controller => 'calendars', :only => [:show, :update]
120 map.resource :calendar, :path_prefix => '/issues', :controller => 'calendars', :only => [:show, :update]
121 map.resource :calendar, :path_prefix => '/projects/:project_id/issues', :controller => 'calendars', :only => [:show, :update]
121 map.resource :calendar, :path_prefix => '/projects/:project_id/issues', :controller => 'calendars', :only => [:show, :update]
122
122
123 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
123 map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports|
124 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
124 reports.connect 'projects/:id/issues/report', :action => 'issue_report'
125 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
125 reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details'
126 end
126 end
127
127
128 # Following two routes conflict with the resources because #index allows POST
128 # Following two routes conflict with the resources because #index allows POST
129 map.connect '/issues', :controller => 'issues', :action => 'index', :conditions => { :method => :post }
129 map.connect '/issues', :controller => 'issues', :action => 'index', :conditions => { :method => :post }
130 map.connect '/issues/create', :controller => 'issues', :action => 'index', :conditions => { :method => :post }
130 map.connect '/issues/create', :controller => 'issues', :action => 'index', :conditions => { :method => :post }
131
131
132 map.resources :issues, :member => { :edit => :post }, :collection => {}
132 map.resources :issues, :member => { :edit => :post }, :collection => {}
133 map.resources :issues, :path_prefix => '/projects/:project_id', :collection => { :create => :post }
133 map.resources :issues, :path_prefix => '/projects/:project_id', :collection => { :create => :post }
134
134
135 map.with_options :controller => 'issue_relations', :conditions => {:method => :post} do |relations|
135 map.with_options :controller => 'issue_relations', :conditions => {:method => :post} do |relations|
136 relations.connect 'issues/:issue_id/relations/:id', :action => 'new'
136 relations.connect 'issues/:issue_id/relations/:id', :action => 'new'
137 relations.connect 'issues/:issue_id/relations/:id/destroy', :action => 'destroy'
137 relations.connect 'issues/:issue_id/relations/:id/destroy', :action => 'destroy'
138 end
138 end
139
139
140 map.with_options :controller => 'news' do |news_routes|
140 map.with_options :controller => 'news' do |news_routes|
141 news_routes.with_options :conditions => {:method => :get} do |news_views|
141 news_routes.with_options :conditions => {:method => :get} do |news_views|
142 news_views.connect 'news', :action => 'index'
142 news_views.connect 'news', :action => 'index'
143 news_views.connect 'projects/:project_id/news', :action => 'index'
143 news_views.connect 'projects/:project_id/news', :action => 'index'
144 news_views.connect 'projects/:project_id/news.:format', :action => 'index'
144 news_views.connect 'projects/:project_id/news.:format', :action => 'index'
145 news_views.connect 'news.:format', :action => 'index'
145 news_views.connect 'news.:format', :action => 'index'
146 news_views.connect 'projects/:project_id/news/new', :action => 'new'
146 news_views.connect 'projects/:project_id/news/new', :action => 'new'
147 news_views.connect 'news/:id', :action => 'show'
147 news_views.connect 'news/:id', :action => 'show'
148 news_views.connect 'news/:id/edit', :action => 'edit'
148 news_views.connect 'news/:id/edit', :action => 'edit'
149 end
149 end
150 news_routes.with_options do |news_actions|
150 news_routes.with_options do |news_actions|
151 news_actions.connect 'projects/:project_id/news', :action => 'new'
151 news_actions.connect 'projects/:project_id/news', :action => 'new'
152 news_actions.connect 'news/:id/edit', :action => 'edit'
152 news_actions.connect 'news/:id/edit', :action => 'edit'
153 news_actions.connect 'news/:id/destroy', :action => 'destroy'
153 news_actions.connect 'news/:id/destroy', :action => 'destroy'
154 end
154 end
155 end
155 end
156
156
157 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new'
157 map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new'
158
158
159 map.with_options :controller => 'users' do |users|
159 map.with_options :controller => 'users' do |users|
160 users.with_options :conditions => {:method => :get} do |user_views|
160 users.with_options :conditions => {:method => :get} do |user_views|
161 user_views.connect 'users', :action => 'index'
161 user_views.connect 'users', :action => 'index'
162 user_views.connect 'users/:id', :action => 'show', :id => /\d+/
162 user_views.connect 'users/:id', :action => 'show', :id => /\d+/
163 user_views.connect 'users/new', :action => 'add'
163 user_views.connect 'users/new', :action => 'add'
164 user_views.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil
164 user_views.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil
165 end
165 end
166 users.with_options :conditions => {:method => :post} do |user_actions|
166 users.with_options :conditions => {:method => :post} do |user_actions|
167 user_actions.connect 'users', :action => 'add'
167 user_actions.connect 'users', :action => 'add'
168 user_actions.connect 'users/new', :action => 'add'
168 user_actions.connect 'users/new', :action => 'add'
169 user_actions.connect 'users/:id/edit', :action => 'edit'
169 user_actions.connect 'users/:id/edit', :action => 'edit'
170 user_actions.connect 'users/:id/memberships', :action => 'edit_membership'
170 user_actions.connect 'users/:id/memberships', :action => 'edit_membership'
171 user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership'
171 user_actions.connect 'users/:id/memberships/:membership_id', :action => 'edit_membership'
172 user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership'
172 user_actions.connect 'users/:id/memberships/:membership_id/destroy', :action => 'destroy_membership'
173 end
173 end
174 end
174 end
175
175
176 map.with_options :controller => 'projects' do |projects|
176 map.resources :projects, :member => {
177 projects.with_options :conditions => {:method => :get} do |project_views|
177 :copy => [:get, :post],
178 project_views.connect 'projects', :action => 'index'
178 :settings => :get,
179 project_views.connect 'projects.:format', :action => 'index'
179 :modules => :post,
180 project_views.connect 'projects/new', :action => 'new'
180 :archive => :post,
181 project_views.connect 'projects/:id', :action => 'show'
181 :unarchive => :post
182 project_views.connect 'projects/:id.:format', :action => 'show'
182 }
183 project_views.connect 'projects/:id/:action', :action => /destroy|settings/
183
184 # Destroy uses a get request to prompt the user before the actual DELETE request
185 map.project_destroy_confirm 'projects/:id/destroy', :controller => 'projects', :action => 'destroy', :conditions => {:method => :get}
186
187 # TODO: port to be part of the resources route(s)
188 map.with_options :controller => 'projects' do |project_mapper|
189 project_mapper.with_options :conditions => {:method => :get} do |project_views|
184 project_views.connect 'projects/:id/files', :controller => 'files', :action => 'index'
190 project_views.connect 'projects/:id/files', :controller => 'files', :action => 'index'
185 project_views.connect 'projects/:id/files/new', :controller => 'files', :action => 'new'
191 project_views.connect 'projects/:id/files/new', :controller => 'files', :action => 'new'
186 project_views.connect 'projects/:id/settings/:tab', :action => 'settings'
192 project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings'
187 project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new'
193 project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new'
188 end
194 end
189
195
190 projects.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity|
196 project_mapper.with_options :conditions => {:method => :post} do |project_actions|
191 activity.connect 'projects/:id/activity'
192 activity.connect 'projects/:id/activity.:format'
193 activity.connect 'activity', :id => nil
194 activity.connect 'activity.:format', :id => nil
195 end
196
197 projects.with_options :conditions => {:method => :post} do |project_actions|
198 project_actions.connect 'projects/new', :action => 'create'
199 project_actions.connect 'projects', :action => 'create'
200 project_actions.connect 'projects.:format', :action => 'create', :format => /xml/
201 project_actions.connect 'projects/:id/edit', :action => 'update'
202 project_actions.connect 'projects/:id/:action', :action => /destroy|archive|unarchive/
203 project_actions.connect 'projects/:id/files/new', :controller => 'files', :action => 'new'
197 project_actions.connect 'projects/:id/files/new', :controller => 'files', :action => 'new'
204 project_actions.connect 'projects/:id/activities/save', :controller => 'project_enumerations', :action => 'save'
198 project_actions.connect 'projects/:id/activities/save', :controller => 'project_enumerations', :action => 'save'
205 end
199 end
206
200
207 projects.with_options :conditions => {:method => :put} do |project_actions|
201 project_mapper.with_options :conditions => {:method => :delete} do |project_actions|
208 project_actions.conditions 'projects/:id.:format', :action => 'update', :format => /xml/
209 end
210
211 projects.with_options :conditions => {:method => :delete} do |project_actions|
212 project_actions.conditions 'projects/:id.:format', :action => 'destroy', :format => /xml/
213 project_actions.conditions 'projects/:id/reset_activities', :controller => 'project_enumerations', :action => 'destroy'
202 project_actions.conditions 'projects/:id/reset_activities', :controller => 'project_enumerations', :action => 'destroy'
214 end
203 end
204
215 end
205 end
216
206
207 map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity|
208 activity.connect 'projects/:id/activity'
209 activity.connect 'projects/:id/activity.:format'
210 activity.connect 'activity', :id => nil
211 activity.connect 'activity.:format', :id => nil
212 end
213
217 map.with_options :controller => 'versions' do |versions|
214 map.with_options :controller => 'versions' do |versions|
218 versions.connect 'projects/:project_id/versions/new', :action => 'new'
215 versions.connect 'projects/:project_id/versions/new', :action => 'new'
219 versions.connect 'projects/:project_id/roadmap', :action => 'index'
216 versions.connect 'projects/:project_id/roadmap', :action => 'index'
220 versions.with_options :conditions => {:method => :post} do |version_actions|
217 versions.with_options :conditions => {:method => :post} do |version_actions|
221 version_actions.connect 'projects/:project_id/versions/close_completed', :action => 'close_completed'
218 version_actions.connect 'projects/:project_id/versions/close_completed', :action => 'close_completed'
222 end
219 end
223 end
220 end
224
221
225 map.with_options :controller => 'issue_categories' do |categories|
222 map.with_options :controller => 'issue_categories' do |categories|
226 categories.connect 'projects/:project_id/issue_categories/new', :action => 'new'
223 categories.connect 'projects/:project_id/issue_categories/new', :action => 'new'
227 end
224 end
228
225
229 map.with_options :controller => 'repositories' do |repositories|
226 map.with_options :controller => 'repositories' do |repositories|
230 repositories.with_options :conditions => {:method => :get} do |repository_views|
227 repositories.with_options :conditions => {:method => :get} do |repository_views|
231 repository_views.connect 'projects/:id/repository', :action => 'show'
228 repository_views.connect 'projects/:id/repository', :action => 'show'
232 repository_views.connect 'projects/:id/repository/edit', :action => 'edit'
229 repository_views.connect 'projects/:id/repository/edit', :action => 'edit'
233 repository_views.connect 'projects/:id/repository/statistics', :action => 'stats'
230 repository_views.connect 'projects/:id/repository/statistics', :action => 'stats'
234 repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions'
231 repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions'
235 repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions'
232 repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions'
236 repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
233 repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision'
237 repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
234 repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff'
238 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
235 repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff'
239 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
236 repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
240 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
237 repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ }
241 repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw'
238 repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw'
242 # TODO: why the following route is required?
239 # TODO: why the following route is required?
243 repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry'
240 repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry'
244 repository_views.connect 'projects/:id/repository/:action/*path'
241 repository_views.connect 'projects/:id/repository/:action/*path'
245 end
242 end
246
243
247 repositories.connect 'projects/:id/repository/:action', :conditions => {:method => :post}
244 repositories.connect 'projects/:id/repository/:action', :conditions => {:method => :post}
248 end
245 end
249
246
250 map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/
247 map.connect 'attachments/:id', :controller => 'attachments', :action => 'show', :id => /\d+/
251 map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/
248 map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/
252 map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/
249 map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/
253
250
254 map.resources :groups
251 map.resources :groups
255
252
256 #left old routes at the bottom for backwards compat
253 #left old routes at the bottom for backwards compat
257 map.connect 'projects/:project_id/issues/:action', :controller => 'issues'
254 map.connect 'projects/:project_id/issues/:action', :controller => 'issues'
258 map.connect 'projects/:project_id/documents/:action', :controller => 'documents'
255 map.connect 'projects/:project_id/documents/:action', :controller => 'documents'
259 map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards'
256 map.connect 'projects/:project_id/boards/:action/:id', :controller => 'boards'
260 map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages'
257 map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages'
261 map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki'
258 map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki'
262 map.connect 'issues/:issue_id/relations/:action/:id', :controller => 'issue_relations'
259 map.connect 'issues/:issue_id/relations/:action/:id', :controller => 'issue_relations'
263 map.connect 'projects/:project_id/news/:action', :controller => 'news'
260 map.connect 'projects/:project_id/news/:action', :controller => 'news'
264 map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/
261 map.connect 'projects/:project_id/timelog/:action/:id', :controller => 'timelog', :project_id => /.+/
265 map.with_options :controller => 'repositories' do |omap|
262 map.with_options :controller => 'repositories' do |omap|
266 omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse'
263 omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse'
267 omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes'
264 omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes'
268 omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff'
265 omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff'
269 omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry'
266 omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry'
270 omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate'
267 omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate'
271 omap.connect 'repositories/revision/:id/:rev', :action => 'revision'
268 omap.connect 'repositories/revision/:id/:rev', :action => 'revision'
272 end
269 end
273
270
274 map.with_options :controller => 'sys' do |sys|
271 map.with_options :controller => 'sys' do |sys|
275 sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get}
272 sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get}
276 sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post}
273 sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post}
277 end
274 end
278
275
279 # Install the default route as the lowest priority.
276 # Install the default route as the lowest priority.
280 map.connect ':controller/:action/:id'
277 map.connect ':controller/:action/:id'
281 map.connect 'robots.txt', :controller => 'welcome', :action => 'robots'
278 map.connect 'robots.txt', :controller => 'welcome', :action => 'robots'
282 # Used for OpenID
279 # Used for OpenID
283 map.root :controller => 'account', :action => 'login'
280 map.root :controller => 'account', :action => 'login'
284 end
281 end
@@ -1,291 +1,290
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006-2010 Jean-Philippe Lang
2 # Copyright (C) 2006-2010 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
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
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.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require "#{File.dirname(__FILE__)}/../test_helper"
18 require "#{File.dirname(__FILE__)}/../test_helper"
19
19
20 class RoutingTest < ActionController::IntegrationTest
20 class RoutingTest < ActionController::IntegrationTest
21 context "activities" do
21 context "activities" do
22 should_route :get, "/activity", :controller => 'activities', :action => 'index', :id => nil
22 should_route :get, "/activity", :controller => 'activities', :action => 'index', :id => nil
23 should_route :get, "/activity.atom", :controller => 'activities', :action => 'index', :id => nil, :format => 'atom'
23 should_route :get, "/activity.atom", :controller => 'activities', :action => 'index', :id => nil, :format => 'atom'
24 end
24 end
25
25
26 context "attachments" do
26 context "attachments" do
27 should_route :get, "/attachments/1", :controller => 'attachments', :action => 'show', :id => '1'
27 should_route :get, "/attachments/1", :controller => 'attachments', :action => 'show', :id => '1'
28 should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext'
28 should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext'
29 should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1'
29 should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1'
30 should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext'
30 should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext'
31 end
31 end
32
32
33 context "boards" do
33 context "boards" do
34 should_route :get, "/projects/world_domination/boards", :controller => 'boards', :action => 'index', :project_id => 'world_domination'
34 should_route :get, "/projects/world_domination/boards", :controller => 'boards', :action => 'index', :project_id => 'world_domination'
35 should_route :get, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination'
35 should_route :get, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination'
36 should_route :get, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44'
36 should_route :get, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44'
37 should_route :get, "/projects/world_domination/boards/44.atom", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44', :format => 'atom'
37 should_route :get, "/projects/world_domination/boards/44.atom", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44', :format => 'atom'
38 should_route :get, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44'
38 should_route :get, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44'
39
39
40 should_route :post, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination'
40 should_route :post, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination'
41 should_route :post, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44'
41 should_route :post, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44'
42 should_route :post, "/projects/world_domination/boards/44/destroy", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44'
42 should_route :post, "/projects/world_domination/boards/44/destroy", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44'
43
43
44 end
44 end
45
45
46 context "documents" do
46 context "documents" do
47 should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567'
47 should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567'
48 should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
48 should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
49 should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22'
49 should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22'
50 should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22'
50 should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22'
51
51
52 should_route :post, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
52 should_route :post, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
53 should_route :post, "/documents/567/edit", :controller => 'documents', :action => 'edit', :id => '567'
53 should_route :post, "/documents/567/edit", :controller => 'documents', :action => 'edit', :id => '567'
54 should_route :post, "/documents/567/destroy", :controller => 'documents', :action => 'destroy', :id => '567'
54 should_route :post, "/documents/567/destroy", :controller => 'documents', :action => 'destroy', :id => '567'
55 end
55 end
56
56
57 context "issues" do
57 context "issues" do
58 # REST actions
58 # REST actions
59 should_route :get, "/issues", :controller => 'issues', :action => 'index'
59 should_route :get, "/issues", :controller => 'issues', :action => 'index'
60 should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf'
60 should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf'
61 should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom'
61 should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom'
62 should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml'
62 should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml'
63 should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23'
63 should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23'
64 should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf'
64 should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf'
65 should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom'
65 should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom'
66 should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml'
66 should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml'
67 should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64'
67 should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64'
68 should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf'
68 should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf'
69 should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom'
69 should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom'
70 should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml'
70 should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml'
71
71
72 should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23'
72 should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23'
73 should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23'
73 should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23'
74 should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml'
74 should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml'
75
75
76 should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
76 should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
77 # TODO: Should use PUT
77 # TODO: Should use PUT
78 should_route :post, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
78 should_route :post, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
79 should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml'
79 should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml'
80
80
81 # TODO: Should use DELETE
81 # TODO: Should use DELETE
82 should_route :post, "/issues/64/destroy", :controller => 'issues', :action => 'destroy', :id => '64'
82 should_route :post, "/issues/64/destroy", :controller => 'issues', :action => 'destroy', :id => '64'
83 should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml'
83 should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml'
84
84
85 # Extra actions
85 # Extra actions
86 should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64'
86 should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64'
87
87
88 should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new'
88 should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new'
89 should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create'
89 should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create'
90
90
91 should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1'
91 should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1'
92
92
93 should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show'
93 should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show'
94 should_route :put, "/issues/calendar", :controller => 'calendars', :action => 'update'
94 should_route :put, "/issues/calendar", :controller => 'calendars', :action => 'update'
95 should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name'
95 should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name'
96 should_route :put, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'update', :project_id => 'project-name'
96 should_route :put, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'update', :project_id => 'project-name'
97
97
98 should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show'
98 should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show'
99 should_route :put, "/issues/gantt", :controller => 'gantts', :action => 'update'
99 should_route :put, "/issues/gantt", :controller => 'gantts', :action => 'update'
100 should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name'
100 should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name'
101 should_route :put, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'update', :project_id => 'project-name'
101 should_route :put, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'update', :project_id => 'project-name'
102
102
103 should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues'
103 should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues'
104
104
105 should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
105 should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
106 should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
106 should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
107 should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
107 should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
108 should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
108 should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
109
109
110 should_route :get, "/issues/changes", :controller => 'journals', :action => 'index'
110 should_route :get, "/issues/changes", :controller => 'journals', :action => 'index'
111
111
112 should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit'
112 should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit'
113 should_route :post, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_update'
113 should_route :post, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_update'
114 end
114 end
115
115
116 context "issue categories" do
116 context "issue categories" do
117 should_route :get, "/projects/test/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'test'
117 should_route :get, "/projects/test/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'test'
118
118
119 should_route :post, "/projects/test/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'test'
119 should_route :post, "/projects/test/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'test'
120 end
120 end
121
121
122 context "issue relations" do
122 context "issue relations" do
123 should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'new', :issue_id => '1'
123 should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'new', :issue_id => '1'
124 should_route :post, "/issues/1/relations/23/destroy", :controller => 'issue_relations', :action => 'destroy', :issue_id => '1', :id => '23'
124 should_route :post, "/issues/1/relations/23/destroy", :controller => 'issue_relations', :action => 'destroy', :issue_id => '1', :id => '23'
125 end
125 end
126
126
127 context "issue reports" do
127 context "issue reports" do
128 should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567'
128 should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567'
129 should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to'
129 should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to'
130 end
130 end
131
131
132 context "members" do
132 context "members" do
133 should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234'
133 should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234'
134 end
134 end
135
135
136 context "messages" do
136 context "messages" do
137 should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22'
137 should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22'
138 should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
138 should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
139 should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
139 should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
140
140
141 should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
141 should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
142 should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
142 should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
143 should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22'
143 should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22'
144 should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22'
144 should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22'
145 end
145 end
146
146
147 context "news" do
147 context "news" do
148 should_route :get, "/news", :controller => 'news', :action => 'index'
148 should_route :get, "/news", :controller => 'news', :action => 'index'
149 should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom'
149 should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom'
150 should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml'
150 should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml'
151 should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json'
151 should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json'
152 should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567'
152 should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567'
153 should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567'
153 should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567'
154 should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567'
154 should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567'
155 should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567'
155 should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567'
156 should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2'
156 should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2'
157 should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
157 should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
158 should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234'
158 should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234'
159
159
160 should_route :post, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
160 should_route :post, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
161 should_route :post, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567'
161 should_route :post, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567'
162 should_route :post, "/news/567/destroy", :controller => 'news', :action => 'destroy', :id => '567'
162 should_route :post, "/news/567/destroy", :controller => 'news', :action => 'destroy', :id => '567'
163 end
163 end
164
164
165 context "projects" do
165 context "projects" do
166 should_route :get, "/projects", :controller => 'projects', :action => 'index'
166 should_route :get, "/projects", :controller => 'projects', :action => 'index'
167 should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom'
167 should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom'
168 should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml'
168 should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml'
169 should_route :get, "/projects/new", :controller => 'projects', :action => 'new'
169 should_route :get, "/projects/new", :controller => 'projects', :action => 'new'
170 should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test'
170 should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test'
171 should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml'
171 should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml'
172 should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223'
172 should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223'
173 should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members'
173 should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members'
174 should_route :get, "/projects/567/destroy", :controller => 'projects', :action => 'destroy', :id => '567'
175 should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :id => '33'
174 should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :id => '33'
176 should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :id => '33'
175 should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :id => '33'
177 should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33'
176 should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33'
178 should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33'
177 should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33'
179 should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom'
178 should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom'
180
179
181 should_route :post, "/projects/new", :controller => 'projects', :action => 'create'
180 should_route :post, "/projects", :controller => 'projects', :action => 'create'
182 should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml'
181 should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml'
183 should_route :post, "/projects/4223/edit", :controller => 'projects', :action => 'update', :id => '4223'
184 should_route :post, "/projects/64/destroy", :controller => 'projects', :action => 'destroy', :id => '64'
185 should_route :post, "/projects/33/files/new", :controller => 'files', :action => 'new', :id => '33'
182 should_route :post, "/projects/33/files/new", :controller => 'files', :action => 'new', :id => '33'
186 should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64'
183 should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64'
187 should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64'
184 should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64'
188 should_route :post, "/projects/64/activities/save", :controller => 'project_enumerations', :action => 'save', :id => '64'
185 should_route :post, "/projects/64/activities/save", :controller => 'project_enumerations', :action => 'save', :id => '64'
189
186
187 should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223'
190 should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml'
188 should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml'
191
189
190 should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64'
192 should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml'
191 should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml'
193 should_route :delete, "/projects/64/reset_activities", :controller => 'project_enumerations', :action => 'destroy', :id => '64'
192 should_route :delete, "/projects/64/reset_activities", :controller => 'project_enumerations', :action => 'destroy', :id => '64'
194 end
193 end
195
194
196 context "repositories" do
195 context "repositories" do
197 should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine'
196 should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine'
198 should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
197 should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
199 should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine'
198 should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine'
200 should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom'
199 should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom'
201 should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457'
200 should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457'
202 should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457'
201 should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457'
203 should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff'
202 should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff'
204 should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c]
203 should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c]
205 should_route :get, "/projects/redmine/repository/revisions/2/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c], :rev => '2'
204 should_route :get, "/projects/redmine/repository/revisions/2/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c], :rev => '2'
206 should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c]
205 should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c]
207 should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c]
206 should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c]
208 should_route :get, "/projects/redmine/repository/revisions/2/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2'
207 should_route :get, "/projects/redmine/repository/revisions/2/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2'
209 should_route :get, "/projects/redmine/repository/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :format => 'raw'
208 should_route :get, "/projects/redmine/repository/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :format => 'raw'
210 should_route :get, "/projects/redmine/repository/revisions/2/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2', :format => 'raw'
209 should_route :get, "/projects/redmine/repository/revisions/2/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2', :format => 'raw'
211 should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c]
210 should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c]
212 should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c]
211 should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c]
213 should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine'
212 should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine'
214
213
215
214
216 should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
215 should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
217 end
216 end
218
217
219 context "timelogs" do
218 context "timelogs" do
220 should_route :get, "/issues/567/time_entries/new", :controller => 'timelog', :action => 'edit', :issue_id => '567'
219 should_route :get, "/issues/567/time_entries/new", :controller => 'timelog', :action => 'edit', :issue_id => '567'
221 should_route :get, "/projects/ecookbook/time_entries/new", :controller => 'timelog', :action => 'edit', :project_id => 'ecookbook'
220 should_route :get, "/projects/ecookbook/time_entries/new", :controller => 'timelog', :action => 'edit', :project_id => 'ecookbook'
222 should_route :get, "/projects/ecookbook/issues/567/time_entries/new", :controller => 'timelog', :action => 'edit', :project_id => 'ecookbook', :issue_id => '567'
221 should_route :get, "/projects/ecookbook/issues/567/time_entries/new", :controller => 'timelog', :action => 'edit', :project_id => 'ecookbook', :issue_id => '567'
223 should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22'
222 should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22'
224 should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report'
223 should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report'
225 should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567'
224 should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567'
226 should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv'
225 should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv'
227 should_route :get, "/time_entries", :controller => 'timelog', :action => 'details'
226 should_route :get, "/time_entries", :controller => 'timelog', :action => 'details'
228 should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'details', :format => 'csv'
227 should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'details', :format => 'csv'
229 should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'details', :format => 'atom'
228 should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'details', :format => 'atom'
230 should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'details', :project_id => '567'
229 should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'details', :project_id => '567'
231 should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'details', :project_id => '567', :format => 'csv'
230 should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'details', :project_id => '567', :format => 'csv'
232 should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'details', :project_id => '567', :format => 'atom'
231 should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'details', :project_id => '567', :format => 'atom'
233 should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'details', :issue_id => '234'
232 should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'details', :issue_id => '234'
234 should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'details', :issue_id => '234', :format => 'csv'
233 should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'details', :issue_id => '234', :format => 'csv'
235 should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'details', :issue_id => '234', :format => 'atom'
234 should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'details', :issue_id => '234', :format => 'atom'
236 should_route :get, "/projects/ecookbook/issues/123/time_entries", :controller => 'timelog', :action => 'details', :project_id => 'ecookbook', :issue_id => '123'
235 should_route :get, "/projects/ecookbook/issues/123/time_entries", :controller => 'timelog', :action => 'details', :project_id => 'ecookbook', :issue_id => '123'
237
236
238 should_route :post, "/time_entries/55/destroy", :controller => 'timelog', :action => 'destroy', :id => '55'
237 should_route :post, "/time_entries/55/destroy", :controller => 'timelog', :action => 'destroy', :id => '55'
239 end
238 end
240
239
241 context "users" do
240 context "users" do
242 should_route :get, "/users", :controller => 'users', :action => 'index'
241 should_route :get, "/users", :controller => 'users', :action => 'index'
243 should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
242 should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
244 should_route :get, "/users/new", :controller => 'users', :action => 'add'
243 should_route :get, "/users/new", :controller => 'users', :action => 'add'
245 should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
244 should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
246 should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership'
245 should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership'
247
246
248 should_route :post, "/users/new", :controller => 'users', :action => 'add'
247 should_route :post, "/users/new", :controller => 'users', :action => 'add'
249 should_route :post, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
248 should_route :post, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
250 should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123'
249 should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123'
251 should_route :post, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55'
250 should_route :post, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55'
252 should_route :post, "/users/567/memberships/12/destroy", :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12'
251 should_route :post, "/users/567/memberships/12/destroy", :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12'
253 end
252 end
254
253
255 context "versions" do
254 context "versions" do
256 should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
255 should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
257
256
258 should_route :post, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
257 should_route :post, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
259 end
258 end
260
259
261 context "wiki (singular, project's pages)" do
260 context "wiki (singular, project's pages)" do
262 should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'index', :id => '567'
261 should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'index', :id => '567'
263 should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'index', :id => '567', :page => 'lalala'
262 should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'index', :id => '567', :page => 'lalala'
264 should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page'
263 should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page'
265 should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :id => '1', :page => 'CookBook_documentation'
264 should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :id => '1', :page => 'CookBook_documentation'
266 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :id => '1', :page => 'CookBook_documentation', :version => '2', :version_from => '1'
265 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :id => '1', :page => 'CookBook_documentation', :version => '2', :version_from => '1'
267 should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :id => '1', :page => 'CookBook_documentation', :version => '2'
266 should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :id => '1', :page => 'CookBook_documentation', :version => '2'
268 should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida'
267 should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida'
269 should_route :get, "/projects/567/wiki/page_index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'page_index'
268 should_route :get, "/projects/567/wiki/page_index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'page_index'
270 should_route :get, "/projects/567/wiki/Page_Index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'Page_Index'
269 should_route :get, "/projects/567/wiki/Page_Index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'Page_Index'
271 should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'date_index'
270 should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'date_index'
272 should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'special', :id => '567', :page => 'export'
271 should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'special', :id => '567', :page => 'export'
273
272
274 should_route :post, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page'
273 should_route :post, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page'
275 should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :id => '567', :page => 'CookBook_documentation'
274 should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :id => '567', :page => 'CookBook_documentation'
276 should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida'
275 should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida'
277 should_route :post, "/projects/22/wiki/ladida/destroy", :controller => 'wiki', :action => 'destroy', :id => '22', :page => 'ladida'
276 should_route :post, "/projects/22/wiki/ladida/destroy", :controller => 'wiki', :action => 'destroy', :id => '22', :page => 'ladida'
278 should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :id => '22', :page => 'ladida'
277 should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :id => '22', :page => 'ladida'
279 end
278 end
280
279
281 context "wikis (plural, admin setup)" do
280 context "wikis (plural, admin setup)" do
282 should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
281 should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
283
282
284 should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida'
283 should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida'
285 should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
284 should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
286 end
285 end
287
286
288 context "administration panel" do
287 context "administration panel" do
289 should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects'
288 should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects'
290 end
289 end
291 end
290 end
General Comments 0
You need to be logged in to leave comments. Login now