@@ -1,46 +1,46 | |||||
1 | <%= call_hook(:view_issues_form_details_top, { :issue => @issue, :form => f }) %> |
|
1 | <%= call_hook(:view_issues_form_details_top, { :issue => @issue, :form => f }) %> | |
2 |
|
2 | |||
3 | <% if @issue.safe_attribute_names.include?('is_private') %> |
|
3 | <% if @issue.safe_attribute_names.include?('is_private') %> | |
4 | <p style="float:right; margin-right:1em;"> |
|
4 | <p style="float:right; margin-right:1em;"> | |
5 | <label class="inline" for="issue_is_private" id="issue_is_private_label"><%= f.check_box :is_private, :no_label => true %> <%= l(:field_is_private) %></label> |
|
5 | <label class="inline" for="issue_is_private" id="issue_is_private_label"><%= f.check_box :is_private, :no_label => true %> <%= l(:field_is_private) %></label> | |
6 | </p> |
|
6 | </p> | |
7 | <% end %> |
|
7 | <% end %> | |
8 | <p><%= f.select :tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true %></p> |
|
8 | <p><%= f.select :tracker_id, @project.trackers.collect {|t| [t.name, t.id]}, :required => true %></p> | |
9 |
<%= observe_field :issue_tracker_id, :url => |
|
9 | <%= observe_field :issue_tracker_id, :url => project_issue_form_path(@project, :id => @issue), | |
10 | :update => :attributes, |
|
10 | :update => :attributes, | |
11 | :with => "Form.serialize('issue-form')" %> |
|
11 | :with => "Form.serialize('issue-form')" %> | |
12 |
|
12 | |||
13 | <p><%= f.text_field :subject, :size => 80, :required => true %></p> |
|
13 | <p><%= f.text_field :subject, :size => 80, :required => true %></p> | |
14 | <p> |
|
14 | <p> | |
15 | <label><%= l(:field_description) %></label> |
|
15 | <label><%= l(:field_description) %></label> | |
16 | <%= link_to_function image_tag('edit.png'), |
|
16 | <%= link_to_function image_tag('edit.png'), | |
17 | 'Element.hide(this); Effect.toggle("issue_description_and_toolbar", "appear", {duration:0.3})' unless @issue.new_record? %> |
|
17 | 'Element.hide(this); Effect.toggle("issue_description_and_toolbar", "appear", {duration:0.3})' unless @issue.new_record? %> | |
18 | <% content_tag 'span', :id => "issue_description_and_toolbar", :style => (@issue.new_record? ? nil : 'display:none') do %> |
|
18 | <% content_tag 'span', :id => "issue_description_and_toolbar", :style => (@issue.new_record? ? nil : 'display:none') do %> | |
19 | <%= f.text_area :description, |
|
19 | <%= f.text_area :description, | |
20 | :cols => 60, |
|
20 | :cols => 60, | |
21 | :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), |
|
21 | :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), | |
22 | :accesskey => accesskey(:edit), |
|
22 | :accesskey => accesskey(:edit), | |
23 | :class => 'wiki-edit', |
|
23 | :class => 'wiki-edit', | |
24 | :no_label => true %> |
|
24 | :no_label => true %> | |
25 | <% end %> |
|
25 | <% end %> | |
26 | </p> |
|
26 | </p> | |
27 |
|
27 | |||
28 | <div id="attributes" class="attributes"> |
|
28 | <div id="attributes" class="attributes"> | |
29 | <%= render :partial => 'issues/attributes' %> |
|
29 | <%= render :partial => 'issues/attributes' %> | |
30 | </div> |
|
30 | </div> | |
31 |
|
31 | |||
32 | <% if @issue.new_record? %> |
|
32 | <% if @issue.new_record? %> | |
33 | <p id="attachments_form"><%= label_tag('attachments[1][file]', l(:label_attachment_plural))%><%= render :partial => 'attachments/form' %></p> |
|
33 | <p id="attachments_form"><%= label_tag('attachments[1][file]', l(:label_attachment_plural))%><%= render :partial => 'attachments/form' %></p> | |
34 | <% end %> |
|
34 | <% end %> | |
35 |
|
35 | |||
36 | <% if @issue.new_record? && User.current.allowed_to?(:add_issue_watchers, @project) -%> |
|
36 | <% if @issue.new_record? && User.current.allowed_to?(:add_issue_watchers, @project) -%> | |
37 | <p id="watchers_form"><label><%= l(:label_issue_watchers) %></label> |
|
37 | <p id="watchers_form"><label><%= l(:label_issue_watchers) %></label> | |
38 | <% @issue.project.users.sort.each do |user| -%> |
|
38 | <% @issue.project.users.sort.each do |user| -%> | |
39 | <label class="floating"><%= check_box_tag 'issue[watcher_user_ids][]', user.id, @issue.watched_by?(user) %> <%=h user %></label> |
|
39 | <label class="floating"><%= check_box_tag 'issue[watcher_user_ids][]', user.id, @issue.watched_by?(user) %> <%=h user %></label> | |
40 | <% end -%> |
|
40 | <% end -%> | |
41 | </p> |
|
41 | </p> | |
42 | <% end %> |
|
42 | <% end %> | |
43 |
|
43 | |||
44 | <%= call_hook(:view_issues_form_details_bottom, { :issue => @issue, :form => f }) %> |
|
44 | <%= call_hook(:view_issues_form_details_bottom, { :issue => @issue, :form => f }) %> | |
45 |
|
45 | |||
46 | <%= wikitoolbar_for 'issue_description' %> |
|
46 | <%= wikitoolbar_for 'issue_description' %> |
@@ -1,262 +1,265 | |||||
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', :conditions => {:method => :get} |
|
9 | map.home '', :controller => 'welcome', :conditions => {:method => :get} | |
10 |
|
10 | |||
11 | map.signin 'login', :controller => 'account', :action => 'login', :conditions => {:method => [:get, :post]} |
|
11 | map.signin 'login', :controller => 'account', :action => 'login', :conditions => {:method => [:get, :post]} | |
12 | map.signout 'logout', :controller => 'account', :action => 'logout', :conditions => {:method => :get} |
|
12 | map.signout 'logout', :controller => 'account', :action => 'logout', :conditions => {:method => :get} | |
13 | map.connect 'account/register', :controller => 'account', :action => 'register', :conditions => {:method => [:get, :post]} |
|
13 | map.connect 'account/register', :controller => 'account', :action => 'register', :conditions => {:method => [:get, :post]} | |
14 | map.connect 'account/lost_password', :controller => 'account', :action => 'lost_password', :conditions => {:method => [:get, :post]} |
|
14 | map.connect 'account/lost_password', :controller => 'account', :action => 'lost_password', :conditions => {:method => [:get, :post]} | |
15 | map.connect 'account/activate', :controller => 'account', :action => 'activate', :conditions => {:method => :get} |
|
15 | map.connect 'account/activate', :controller => 'account', :action => 'activate', :conditions => {:method => :get} | |
16 |
|
16 | |||
17 | map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow' |
|
17 | map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow' | |
18 |
|
18 | |||
19 | map.connect 'help/:ctrl/:page', :controller => 'help', :conditions => {:method => :get} |
|
19 | map.connect 'help/:ctrl/:page', :controller => 'help', :conditions => {:method => :get} | |
20 |
|
20 | |||
21 | map.connect '/time_entries/destroy', |
|
21 | map.connect '/time_entries/destroy', | |
22 | :controller => 'timelog', :action => 'destroy', :conditions => { :method => :delete } |
|
22 | :controller => 'timelog', :action => 'destroy', :conditions => { :method => :delete } | |
23 | map.time_entries_context_menu '/time_entries/context_menu', |
|
23 | map.time_entries_context_menu '/time_entries/context_menu', | |
24 | :controller => 'context_menus', :action => 'time_entries' |
|
24 | :controller => 'context_menus', :action => 'time_entries' | |
25 |
|
25 | |||
26 | map.resources :time_entries, :controller => 'timelog', :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post} |
|
26 | map.resources :time_entries, :controller => 'timelog', :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post} | |
27 |
|
27 | |||
28 | map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post} |
|
28 | map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post} | |
29 | map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => [:get, :post]} |
|
29 | map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => [:get, :post]} | |
30 |
|
30 | |||
31 | map.with_options :controller => 'messages' do |messages_routes| |
|
31 | map.with_options :controller => 'messages' do |messages_routes| | |
32 | messages_routes.with_options :conditions => {:method => :get} do |messages_views| |
|
32 | messages_routes.with_options :conditions => {:method => :get} do |messages_views| | |
33 | messages_views.connect 'boards/:board_id/topics/new', :action => 'new' |
|
33 | messages_views.connect 'boards/:board_id/topics/new', :action => 'new' | |
34 | messages_views.connect 'boards/:board_id/topics/:id', :action => 'show' |
|
34 | messages_views.connect 'boards/:board_id/topics/:id', :action => 'show' | |
35 | messages_views.connect 'boards/:board_id/topics/quote/:id', :action => 'quote' |
|
35 | messages_views.connect 'boards/:board_id/topics/quote/:id', :action => 'quote' | |
36 | messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit' |
|
36 | messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit' | |
37 | end |
|
37 | end | |
38 | messages_routes.with_options :conditions => {:method => :post} do |messages_actions| |
|
38 | messages_routes.with_options :conditions => {:method => :post} do |messages_actions| | |
39 | messages_actions.connect 'boards/:board_id/topics/new', :action => 'new' |
|
39 | messages_actions.connect 'boards/:board_id/topics/new', :action => 'new' | |
40 | messages_actions.connect 'boards/:board_id/topics/preview', :action => 'preview' |
|
40 | messages_actions.connect 'boards/:board_id/topics/preview', :action => 'preview' | |
41 | messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply' |
|
41 | messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply' | |
42 | messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/ |
|
42 | messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/ | |
43 | end |
|
43 | end | |
44 | end |
|
44 | end | |
45 |
|
45 | |||
46 | map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move' |
|
46 | map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move' | |
47 | map.resources :queries, :except => [:show] |
|
47 | map.resources :queries, :except => [:show] | |
48 |
|
48 | |||
49 | # Misc issue routes. TODO: move into resources |
|
49 | # Misc issue routes. TODO: move into resources | |
50 | map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues', :conditions => { :method => :get } |
|
50 | map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues', :conditions => { :method => :get } | |
51 | map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview |
|
51 | map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview | |
52 | map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues' |
|
52 | map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues' | |
53 | map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index' |
|
53 | map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index' | |
54 | map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post } |
|
54 | map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post } | |
55 |
|
55 | |||
56 | map.connect '/journals/diff/:id', :controller => 'journals', :action => 'diff', :id => /\d+/, :conditions => { :method => :get } |
|
56 | map.connect '/journals/diff/:id', :controller => 'journals', :action => 'diff', :id => /\d+/, :conditions => { :method => :get } | |
57 | map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit', :id => /\d+/, :conditions => { :method => [:get, :post] } |
|
57 | map.connect '/journals/edit/:id', :controller => 'journals', :action => 'edit', :id => /\d+/, :conditions => { :method => [:get, :post] } | |
58 |
|
58 | |||
59 | map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes| |
|
59 | map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes| | |
60 | gantts_routes.connect '/projects/:project_id/issues/gantt' |
|
60 | gantts_routes.connect '/projects/:project_id/issues/gantt' | |
61 | gantts_routes.connect '/projects/:project_id/issues/gantt.:format' |
|
61 | gantts_routes.connect '/projects/:project_id/issues/gantt.:format' | |
62 | gantts_routes.connect '/issues/gantt.:format' |
|
62 | gantts_routes.connect '/issues/gantt.:format' | |
63 | end |
|
63 | end | |
64 |
|
64 | |||
65 | map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes| |
|
65 | map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes| | |
66 | calendars_routes.connect '/projects/:project_id/issues/calendar' |
|
66 | calendars_routes.connect '/projects/:project_id/issues/calendar' | |
67 | calendars_routes.connect '/issues/calendar' |
|
67 | calendars_routes.connect '/issues/calendar' | |
68 | end |
|
68 | end | |
69 |
|
69 | |||
70 | map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports| |
|
70 | map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports| | |
71 | reports.connect 'projects/:id/issues/report', :action => 'issue_report' |
|
71 | reports.connect 'projects/:id/issues/report', :action => 'issue_report' | |
72 | reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details' |
|
72 | reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details' | |
73 | end |
|
73 | end | |
74 |
|
74 | |||
75 | map.connect 'my/account', :controller => 'my', :action => 'account', :conditions => {:method => [:get, :post]} |
|
75 | map.connect 'my/account', :controller => 'my', :action => 'account', :conditions => {:method => [:get, :post]} | |
76 | map.connect 'my/page', :controller => 'my', :action => 'page', :conditions => {:method => :get} |
|
76 | map.connect 'my/page', :controller => 'my', :action => 'page', :conditions => {:method => :get} | |
77 | map.connect 'my', :controller => 'my', :action => 'index', :conditions => {:method => :get} # Redirects to my/page |
|
77 | map.connect 'my', :controller => 'my', :action => 'index', :conditions => {:method => :get} # Redirects to my/page | |
78 | map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :conditions => {:method => :post} |
|
78 | map.connect 'my/reset_rss_key', :controller => 'my', :action => 'reset_rss_key', :conditions => {:method => :post} | |
79 | map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :conditions => {:method => :post} |
|
79 | map.connect 'my/reset_api_key', :controller => 'my', :action => 'reset_api_key', :conditions => {:method => :post} | |
80 | map.connect 'my/password', :controller => 'my', :action => 'password', :conditions => {:method => [:get, :post]} |
|
80 | map.connect 'my/password', :controller => 'my', :action => 'password', :conditions => {:method => [:get, :post]} | |
81 | map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout', :conditions => {:method => :get} |
|
81 | map.connect 'my/page_layout', :controller => 'my', :action => 'page_layout', :conditions => {:method => :get} | |
82 | map.connect 'my/add_block', :controller => 'my', :action => 'add_block', :conditions => {:method => :post} |
|
82 | map.connect 'my/add_block', :controller => 'my', :action => 'add_block', :conditions => {:method => :post} | |
83 | map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block', :conditions => {:method => :post} |
|
83 | map.connect 'my/remove_block', :controller => 'my', :action => 'remove_block', :conditions => {:method => :post} | |
84 | map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :conditions => {:method => :post} |
|
84 | map.connect 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :conditions => {:method => :post} | |
85 |
|
85 | |||
86 | map.resources :issues, :collection => {:bulk_edit => :get, :bulk_update => :post} do |issues| |
|
86 | map.resources :issues, :collection => {:bulk_edit => :get, :bulk_update => :post} do |issues| | |
87 | issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get} |
|
87 | issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get} | |
88 | issues.resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy] |
|
88 | issues.resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy] | |
89 | end |
|
89 | end | |
90 | # Bulk deletion |
|
90 | # Bulk deletion | |
91 | map.connect '/issues', :controller => 'issues', :action => 'destroy', :conditions => {:method => :delete} |
|
91 | map.connect '/issues', :controller => 'issues', :action => 'destroy', :conditions => {:method => :delete} | |
92 |
|
92 | |||
93 | map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new', :conditions => { :method => :post } |
|
93 | map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new', :conditions => { :method => :post } | |
94 | map.connect 'members/edit/:id', :controller => 'members', :action => 'edit', :id => /\d+/, :conditions => { :method => :post } |
|
94 | map.connect 'members/edit/:id', :controller => 'members', :action => 'edit', :id => /\d+/, :conditions => { :method => :post } | |
95 | map.connect 'members/destroy/:id', :controller => 'members', :action => 'destroy', :id => /\d+/, :conditions => { :method => :post } |
|
95 | map.connect 'members/destroy/:id', :controller => 'members', :action => 'destroy', :id => /\d+/, :conditions => { :method => :post } | |
96 | map.connect 'members/autocomplete_for_member/:id', :controller => 'members', :action => 'autocomplete_for_member', :conditions => { :method => :post } |
|
96 | map.connect 'members/autocomplete_for_member/:id', :controller => 'members', :action => 'autocomplete_for_member', :conditions => { :method => :post } | |
97 |
|
97 | |||
98 | map.resources :users |
|
98 | map.resources :users | |
99 | map.with_options :controller => 'users' do |users| |
|
99 | map.with_options :controller => 'users' do |users| | |
100 | users.user_memberships 'users/:id/memberships', :action => 'edit_membership', :conditions => {:method => :post} |
|
100 | users.user_memberships 'users/:id/memberships', :action => 'edit_membership', :conditions => {:method => :post} | |
101 | users.user_membership 'users/:id/memberships/:membership_id', :action => 'edit_membership', :conditions => {:method => :put} |
|
101 | users.user_membership 'users/:id/memberships/:membership_id', :action => 'edit_membership', :conditions => {:method => :put} | |
102 | users.connect 'users/:id/memberships/:membership_id', :action => 'destroy_membership', :conditions => {:method => :delete} |
|
102 | users.connect 'users/:id/memberships/:membership_id', :action => 'destroy_membership', :conditions => {:method => :delete} | |
103 | end |
|
103 | end | |
104 |
|
104 | |||
105 | # For nice "roadmap" in the url for the index action |
|
105 | # For nice "roadmap" in the url for the index action | |
106 | map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index' |
|
106 | map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index' | |
107 |
|
107 | |||
108 | map.all_news 'news', :controller => 'news', :action => 'index' |
|
108 | map.all_news 'news', :controller => 'news', :action => 'index' | |
109 | map.formatted_all_news 'news.:format', :controller => 'news', :action => 'index' |
|
109 | map.formatted_all_news 'news.:format', :controller => 'news', :action => 'index' | |
110 | map.preview_news '/news/preview', :controller => 'previews', :action => 'news' |
|
110 | map.preview_news '/news/preview', :controller => 'previews', :action => 'news' | |
111 | map.connect 'news/:id/comments', :controller => 'comments', :action => 'create', :conditions => {:method => :post} |
|
111 | map.connect 'news/:id/comments', :controller => 'comments', :action => 'create', :conditions => {:method => :post} | |
112 | map.connect 'news/:id/comments/:comment_id', :controller => 'comments', :action => 'destroy', :conditions => {:method => :delete} |
|
112 | map.connect 'news/:id/comments/:comment_id', :controller => 'comments', :action => 'destroy', :conditions => {:method => :delete} | |
113 |
|
113 | |||
114 | map.connect 'watchers/new', :controller=> 'watchers', :action => 'new', :conditions => {:method => [:get, :post]} |
|
114 | map.connect 'watchers/new', :controller=> 'watchers', :action => 'new', :conditions => {:method => [:get, :post]} | |
115 | map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy', :conditions => {:method => :post} |
|
115 | map.connect 'watchers/destroy', :controller=> 'watchers', :action => 'destroy', :conditions => {:method => :post} | |
116 | map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch', :conditions => {:method => :post} |
|
116 | map.connect 'watchers/watch', :controller=> 'watchers', :action => 'watch', :conditions => {:method => :post} | |
117 | map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch', :conditions => {:method => :post} |
|
117 | map.connect 'watchers/unwatch', :controller=> 'watchers', :action => 'unwatch', :conditions => {:method => :post} | |
118 |
|
118 | |||
119 | map.resources :projects, :member => { |
|
119 | map.resources :projects, :member => { | |
120 | :copy => [:get, :post], |
|
120 | :copy => [:get, :post], | |
121 | :settings => :get, |
|
121 | :settings => :get, | |
122 | :modules => :post, |
|
122 | :modules => :post, | |
123 | :archive => :post, |
|
123 | :archive => :post, | |
124 | :unarchive => :post |
|
124 | :unarchive => :post | |
125 | } do |project| |
|
125 | } do |project| | |
126 | project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy] |
|
126 | project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy] | |
127 | project.resources :issues, :only => [:index, :new, :create] do |issues| |
|
127 | project.resources :issues, :only => [:index, :new, :create] do |issues| | |
128 | issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get} |
|
128 | issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get} | |
129 | end |
|
129 | end | |
|
130 | # issue form update | |||
|
131 | project.issue_form 'issues/new', :controller => 'issues', :action => 'new', :conditions => {:method => :post} | |||
|
132 | ||||
130 | project.resources :files, :only => [:index, :new, :create] |
|
133 | project.resources :files, :only => [:index, :new, :create] | |
131 | project.resources :versions, :shallow => true, :collection => {:close_completed => :put}, :member => {:status_by => :post} |
|
134 | project.resources :versions, :shallow => true, :collection => {:close_completed => :put}, :member => {:status_by => :post} | |
132 | project.resources :news, :shallow => true |
|
135 | project.resources :news, :shallow => true | |
133 | project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id', :collection => {:report => :get} |
|
136 | project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id', :collection => {:report => :get} | |
134 | project.resources :queries, :only => [:new, :create] |
|
137 | project.resources :queries, :only => [:new, :create] | |
135 | project.resources :issue_categories, :shallow => true |
|
138 | project.resources :issue_categories, :shallow => true | |
136 | project.resources :documents, :shallow => true, :member => {:add_attachment => :post} |
|
139 | project.resources :documents, :shallow => true, :member => {:add_attachment => :post} | |
137 | project.resources :boards |
|
140 | project.resources :boards | |
138 |
|
141 | |||
139 | project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get} |
|
142 | project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get} | |
140 | project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get} |
|
143 | project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get} | |
141 | project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil |
|
144 | project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil | |
142 | project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff' |
|
145 | project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff' | |
143 | project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate' |
|
146 | project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate' | |
144 | project.resources :wiki, :except => [:new, :create], :member => { |
|
147 | project.resources :wiki, :except => [:new, :create], :member => { | |
145 | :rename => [:get, :post], |
|
148 | :rename => [:get, :post], | |
146 | :history => :get, |
|
149 | :history => :get, | |
147 | :preview => :any, |
|
150 | :preview => :any, | |
148 | :protect => :post, |
|
151 | :protect => :post, | |
149 | :add_attachment => :post |
|
152 | :add_attachment => :post | |
150 | }, :collection => { |
|
153 | }, :collection => { | |
151 | :export => :get, |
|
154 | :export => :get, | |
152 | :date_index => :get |
|
155 | :date_index => :get | |
153 | } |
|
156 | } | |
154 |
|
157 | |||
155 | end |
|
158 | end | |
156 |
|
159 | |||
157 | # TODO: port to be part of the resources route(s) |
|
160 | # TODO: port to be part of the resources route(s) | |
158 | map.with_options :controller => 'projects' do |project_mapper| |
|
161 | map.with_options :controller => 'projects' do |project_mapper| | |
159 | project_mapper.with_options :conditions => {:method => :get} do |project_views| |
|
162 | project_mapper.with_options :conditions => {:method => :get} do |project_views| | |
160 | project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings' |
|
163 | project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings' | |
161 | project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new' |
|
164 | project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new' | |
162 | end |
|
165 | end | |
163 | end |
|
166 | end | |
164 |
|
167 | |||
165 | map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity| |
|
168 | map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity| | |
166 | activity.connect 'projects/:id/activity' |
|
169 | activity.connect 'projects/:id/activity' | |
167 | activity.connect 'projects/:id/activity.:format' |
|
170 | activity.connect 'projects/:id/activity.:format' | |
168 | activity.connect 'activity', :id => nil |
|
171 | activity.connect 'activity', :id => nil | |
169 | activity.connect 'activity.:format', :id => nil |
|
172 | activity.connect 'activity.:format', :id => nil | |
170 | end |
|
173 | end | |
171 |
|
174 | |||
172 | map.with_options :controller => 'repositories' do |repositories| |
|
175 | map.with_options :controller => 'repositories' do |repositories| | |
173 | repositories.with_options :conditions => {:method => :get} do |repository_views| |
|
176 | repositories.with_options :conditions => {:method => :get} do |repository_views| | |
174 | repository_views.connect 'projects/:id/repository', :action => 'show' |
|
177 | repository_views.connect 'projects/:id/repository', :action => 'show' | |
175 | repository_views.connect 'projects/:id/repository/edit', :action => 'edit' |
|
178 | repository_views.connect 'projects/:id/repository/edit', :action => 'edit' | |
176 | repository_views.connect 'projects/:id/repository/statistics', :action => 'stats' |
|
179 | repository_views.connect 'projects/:id/repository/statistics', :action => 'stats' | |
177 | repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions' |
|
180 | repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions' | |
178 | repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions' |
|
181 | repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions' | |
179 | repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision' |
|
182 | repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision' | |
180 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff' |
|
183 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff' | |
181 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff' |
|
184 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff' | |
182 | repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ } |
|
185 | repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ } | |
183 | repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ } |
|
186 | repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ } | |
184 | repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw' |
|
187 | repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw' | |
185 | repository_views.connect 'projects/:id/repository/browse/*path', :action => 'browse' |
|
188 | repository_views.connect 'projects/:id/repository/browse/*path', :action => 'browse' | |
186 | repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry' |
|
189 | repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry' | |
187 | repository_views.connect 'projects/:id/repository/changes/*path', :action => 'changes' |
|
190 | repository_views.connect 'projects/:id/repository/changes/*path', :action => 'changes' | |
188 | repository_views.connect 'projects/:id/repository/annotate/*path', :action => 'annotate' |
|
191 | repository_views.connect 'projects/:id/repository/annotate/*path', :action => 'annotate' | |
189 | repository_views.connect 'projects/:id/repository/diff/*path', :action => 'diff' |
|
192 | repository_views.connect 'projects/:id/repository/diff/*path', :action => 'diff' | |
190 | repository_views.connect 'projects/:id/repository/graph', :action => 'graph' |
|
193 | repository_views.connect 'projects/:id/repository/graph', :action => 'graph' | |
191 | end |
|
194 | end | |
192 |
|
195 | |||
193 | repositories.connect 'projects/:id/repository/revision', :action => 'revision', :conditions => {:method => [:get, :post]} |
|
196 | repositories.connect 'projects/:id/repository/revision', :action => 'revision', :conditions => {:method => [:get, :post]} | |
194 | repositories.connect 'projects/:id/repository/committers', :action => 'committers', :conditions => {:method => [:get, :post]} |
|
197 | repositories.connect 'projects/:id/repository/committers', :action => 'committers', :conditions => {:method => [:get, :post]} | |
195 | repositories.connect 'projects/:id/repository/edit', :action => 'edit', :conditions => {:method => :post} |
|
198 | repositories.connect 'projects/:id/repository/edit', :action => 'edit', :conditions => {:method => :post} | |
196 | repositories.connect 'projects/:id/repository/destroy', :action => 'destroy', :conditions => {:method => :post} |
|
199 | repositories.connect 'projects/:id/repository/destroy', :action => 'destroy', :conditions => {:method => :post} | |
197 | end |
|
200 | end | |
198 |
|
201 | |||
199 | map.resources :attachments, :only => [:show, :destroy] |
|
202 | map.resources :attachments, :only => [:show, :destroy] | |
200 | # additional routes for having the file name at the end of url |
|
203 | # additional routes for having the file name at the end of url | |
201 | map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/, :conditions => {:method => :get} |
|
204 | map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/, :conditions => {:method => :get} | |
202 | map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/, :conditions => {:method => :get} |
|
205 | map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/, :conditions => {:method => :get} | |
203 | map.connect 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/, :conditions => {:method => :get} |
|
206 | map.connect 'attachments/download/:id', :controller => 'attachments', :action => 'download', :id => /\d+/, :conditions => {:method => :get} | |
204 |
|
207 | |||
205 | map.resources :groups, :member => {:autocomplete_for_user => :get} |
|
208 | map.resources :groups, :member => {:autocomplete_for_user => :get} | |
206 | map.group_users 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :conditions => {:method => :post} |
|
209 | map.group_users 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :conditions => {:method => :post} | |
207 | map.group_user 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :conditions => {:method => :delete} |
|
210 | map.group_user 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :conditions => {:method => :delete} | |
208 | map.connect 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :conditions => {:method => :post} |
|
211 | map.connect 'groups/destroy_membership/:id', :controller => 'groups', :action => 'destroy_membership', :id => /\d+/, :conditions => {:method => :post} | |
209 | map.connect 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :conditions => {:method => :post} |
|
212 | map.connect 'groups/edit_membership/:id', :controller => 'groups', :action => 'edit_membership', :id => /\d+/, :conditions => {:method => :post} | |
210 |
|
213 | |||
211 | map.resources :trackers, :except => :show |
|
214 | map.resources :trackers, :except => :show | |
212 | map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post} |
|
215 | map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post} | |
213 | map.resources :custom_fields, :except => :show |
|
216 | map.resources :custom_fields, :except => :show | |
214 | map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]} |
|
217 | map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]} | |
215 | map.resources :enumerations, :except => :show |
|
218 | map.resources :enumerations, :except => :show | |
216 |
|
219 | |||
217 | map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get} |
|
220 | map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get} | |
218 |
|
221 | |||
219 | map.connect 'mail_handler', :controller => 'mail_handler', :action => 'index', :conditions => {:method => :post} |
|
222 | map.connect 'mail_handler', :controller => 'mail_handler', :action => 'index', :conditions => {:method => :post} | |
220 |
|
223 | |||
221 | map.connect 'admin', :controller => 'admin', :action => 'index', :conditions => {:method => :get} |
|
224 | map.connect 'admin', :controller => 'admin', :action => 'index', :conditions => {:method => :get} | |
222 | map.connect 'admin/projects', :controller => 'admin', :action => 'projects', :conditions => {:method => :get} |
|
225 | map.connect 'admin/projects', :controller => 'admin', :action => 'projects', :conditions => {:method => :get} | |
223 | map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins', :conditions => {:method => :get} |
|
226 | map.connect 'admin/plugins', :controller => 'admin', :action => 'plugins', :conditions => {:method => :get} | |
224 | map.connect 'admin/info', :controller => 'admin', :action => 'info', :conditions => {:method => :get} |
|
227 | map.connect 'admin/info', :controller => 'admin', :action => 'info', :conditions => {:method => :get} | |
225 | map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email', :conditions => {:method => :get} |
|
228 | map.connect 'admin/test_email', :controller => 'admin', :action => 'test_email', :conditions => {:method => :get} | |
226 | map.connect 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :conditions => {:method => :post} |
|
229 | map.connect 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :conditions => {:method => :post} | |
227 |
|
230 | |||
228 | # Used by AuthSourcesControllerTest |
|
231 | # Used by AuthSourcesControllerTest | |
229 | # TODO : refactor *AuthSourcesController to remove these routes |
|
232 | # TODO : refactor *AuthSourcesController to remove these routes | |
230 | map.connect 'auth_sources', :controller => 'auth_sources', :action => 'index', :conditions => {:method => :get} |
|
233 | map.connect 'auth_sources', :controller => 'auth_sources', :action => 'index', :conditions => {:method => :get} | |
231 | map.connect 'auth_sources/new', :controller => 'auth_sources', :action => 'new', :conditions => {:method => :get} |
|
234 | map.connect 'auth_sources/new', :controller => 'auth_sources', :action => 'new', :conditions => {:method => :get} | |
232 | map.connect 'auth_sources/create', :controller => 'auth_sources', :action => 'create', :conditions => {:method => :post} |
|
235 | map.connect 'auth_sources/create', :controller => 'auth_sources', :action => 'create', :conditions => {:method => :post} | |
233 | map.connect 'auth_sources/destroy/:id', :controller => 'auth_sources', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post} |
|
236 | map.connect 'auth_sources/destroy/:id', :controller => 'auth_sources', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post} | |
234 | map.connect 'auth_sources/test_connection/:id', :controller => 'auth_sources', :action => 'test_connection', :conditions => {:method => :get} |
|
237 | map.connect 'auth_sources/test_connection/:id', :controller => 'auth_sources', :action => 'test_connection', :conditions => {:method => :get} | |
235 | map.connect 'auth_sources/edit/:id', :controller => 'auth_sources', :action => 'edit', :id => /\d+/, :conditions => {:method => :get} |
|
238 | map.connect 'auth_sources/edit/:id', :controller => 'auth_sources', :action => 'edit', :id => /\d+/, :conditions => {:method => :get} | |
236 | map.connect 'auth_sources/update/:id', :controller => 'auth_sources', :action => 'update', :id => /\d+/, :conditions => {:method => :post} |
|
239 | map.connect 'auth_sources/update/:id', :controller => 'auth_sources', :action => 'update', :id => /\d+/, :conditions => {:method => :post} | |
237 |
|
240 | |||
238 | map.connect 'ldap_auth_sources', :controller => 'ldap_auth_sources', :action => 'index', :conditions => {:method => :get} |
|
241 | map.connect 'ldap_auth_sources', :controller => 'ldap_auth_sources', :action => 'index', :conditions => {:method => :get} | |
239 | map.connect 'ldap_auth_sources/new', :controller => 'ldap_auth_sources', :action => 'new', :conditions => {:method => :get} |
|
242 | map.connect 'ldap_auth_sources/new', :controller => 'ldap_auth_sources', :action => 'new', :conditions => {:method => :get} | |
240 | map.connect 'ldap_auth_sources/create', :controller => 'ldap_auth_sources', :action => 'create', :conditions => {:method => :post} |
|
243 | map.connect 'ldap_auth_sources/create', :controller => 'ldap_auth_sources', :action => 'create', :conditions => {:method => :post} | |
241 | map.connect 'ldap_auth_sources/destroy/:id', :controller => 'ldap_auth_sources', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post} |
|
244 | map.connect 'ldap_auth_sources/destroy/:id', :controller => 'ldap_auth_sources', :action => 'destroy', :id => /\d+/, :conditions => {:method => :post} | |
242 | map.connect 'ldap_auth_sources/test_connection/:id', :controller => 'ldap_auth_sources', :action => 'test_connection', :conditions => {:method => :get} |
|
245 | map.connect 'ldap_auth_sources/test_connection/:id', :controller => 'ldap_auth_sources', :action => 'test_connection', :conditions => {:method => :get} | |
243 | map.connect 'ldap_auth_sources/edit/:id', :controller => 'ldap_auth_sources', :action => 'edit', :id => /\d+/, :conditions => {:method => :get} |
|
246 | map.connect 'ldap_auth_sources/edit/:id', :controller => 'ldap_auth_sources', :action => 'edit', :id => /\d+/, :conditions => {:method => :get} | |
244 | map.connect 'ldap_auth_sources/update/:id', :controller => 'ldap_auth_sources', :action => 'update', :id => /\d+/, :conditions => {:method => :post} |
|
247 | map.connect 'ldap_auth_sources/update/:id', :controller => 'ldap_auth_sources', :action => 'update', :id => /\d+/, :conditions => {:method => :post} | |
245 | map.connect 'workflows', :controller => 'workflows', :action => 'index', :conditions => {:method => :get} |
|
248 | map.connect 'workflows', :controller => 'workflows', :action => 'index', :conditions => {:method => :get} | |
246 | map.connect 'workflows/edit', :controller => 'workflows', :action => 'edit', :conditions => {:method => [:get, :post]} |
|
249 | map.connect 'workflows/edit', :controller => 'workflows', :action => 'edit', :conditions => {:method => [:get, :post]} | |
247 | map.connect 'workflows/copy', :controller => 'workflows', :action => 'copy', :conditions => {:method => [:get, :post]} |
|
250 | map.connect 'workflows/copy', :controller => 'workflows', :action => 'copy', :conditions => {:method => [:get, :post]} | |
248 | map.connect 'settings', :controller => 'settings', :action => 'index', :conditions => {:method => :get} |
|
251 | map.connect 'settings', :controller => 'settings', :action => 'index', :conditions => {:method => :get} | |
249 | map.connect 'settings/edit', :controller => 'settings', :action => 'edit', :conditions => {:method => [:get, :post]} |
|
252 | map.connect 'settings/edit', :controller => 'settings', :action => 'edit', :conditions => {:method => [:get, :post]} | |
250 | map.connect 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :conditions => {:method => [:get, :post]} |
|
253 | map.connect 'settings/plugin/:id', :controller => 'settings', :action => 'plugin', :conditions => {:method => [:get, :post]} | |
251 |
|
254 | |||
252 | map.with_options :controller => 'sys' do |sys| |
|
255 | map.with_options :controller => 'sys' do |sys| | |
253 | sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get} |
|
256 | sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get} | |
254 | sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post} |
|
257 | sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post} | |
255 | sys.connect 'sys/fetch_changesets', :action => 'fetch_changesets', :conditions => {:method => :get} |
|
258 | sys.connect 'sys/fetch_changesets', :action => 'fetch_changesets', :conditions => {:method => :get} | |
256 | end |
|
259 | end | |
257 |
|
260 | |||
258 | map.connect 'robots.txt', :controller => 'welcome', :action => 'robots', :conditions => {:method => :get} |
|
261 | map.connect 'robots.txt', :controller => 'welcome', :action => 'robots', :conditions => {:method => :get} | |
259 |
|
262 | |||
260 | # Used for OpenID |
|
263 | # Used for OpenID | |
261 | map.root :controller => 'account', :action => 'login' |
|
264 | map.root :controller => 'account', :action => 'login' | |
262 | end |
|
265 | end |
@@ -1,200 +1,209 | |||||
1 | # Redmine - project management software |
|
1 | # Redmine - project management software | |
2 | # Copyright (C) 2006-2011 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006-2011 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.expand_path('../../test_helper', __FILE__) |
|
18 | require File.expand_path('../../test_helper', __FILE__) | |
19 |
|
19 | |||
20 | class IssuesTest < ActionController::IntegrationTest |
|
20 | class IssuesTest < ActionController::IntegrationTest | |
21 | fixtures :projects, |
|
21 | fixtures :projects, | |
22 | :users, |
|
22 | :users, | |
23 | :roles, |
|
23 | :roles, | |
24 | :members, |
|
24 | :members, | |
25 | :trackers, |
|
25 | :trackers, | |
26 | :projects_trackers, |
|
26 | :projects_trackers, | |
27 | :enabled_modules, |
|
27 | :enabled_modules, | |
28 | :issue_statuses, |
|
28 | :issue_statuses, | |
29 | :issues, |
|
29 | :issues, | |
30 | :enumerations, |
|
30 | :enumerations, | |
31 | :custom_fields, |
|
31 | :custom_fields, | |
32 | :custom_values, |
|
32 | :custom_values, | |
33 | :custom_fields_trackers |
|
33 | :custom_fields_trackers | |
34 |
|
34 | |||
35 | # create an issue |
|
35 | # create an issue | |
36 | def test_add_issue |
|
36 | def test_add_issue | |
37 | log_user('jsmith', 'jsmith') |
|
37 | log_user('jsmith', 'jsmith') | |
38 | get 'projects/1/issues/new', :tracker_id => '1' |
|
38 | get 'projects/1/issues/new', :tracker_id => '1' | |
39 | assert_response :success |
|
39 | assert_response :success | |
40 | assert_template 'issues/new' |
|
40 | assert_template 'issues/new' | |
41 |
|
41 | |||
42 | post 'projects/1/issues', :tracker_id => "1", |
|
42 | post 'projects/1/issues', :tracker_id => "1", | |
43 | :issue => { :start_date => "2006-12-26", |
|
43 | :issue => { :start_date => "2006-12-26", | |
44 | :priority_id => "4", |
|
44 | :priority_id => "4", | |
45 | :subject => "new test issue", |
|
45 | :subject => "new test issue", | |
46 | :category_id => "", |
|
46 | :category_id => "", | |
47 | :description => "new issue", |
|
47 | :description => "new issue", | |
48 | :done_ratio => "0", |
|
48 | :done_ratio => "0", | |
49 | :due_date => "", |
|
49 | :due_date => "", | |
50 | :assigned_to_id => "" }, |
|
50 | :assigned_to_id => "" }, | |
51 | :custom_fields => {'2' => 'Value for field 2'} |
|
51 | :custom_fields => {'2' => 'Value for field 2'} | |
52 | # find created issue |
|
52 | # find created issue | |
53 | issue = Issue.find_by_subject("new test issue") |
|
53 | issue = Issue.find_by_subject("new test issue") | |
54 | assert_kind_of Issue, issue |
|
54 | assert_kind_of Issue, issue | |
55 |
|
55 | |||
56 | # check redirection |
|
56 | # check redirection | |
57 | assert_redirected_to :controller => 'issues', :action => 'show', :id => issue |
|
57 | assert_redirected_to :controller => 'issues', :action => 'show', :id => issue | |
58 | follow_redirect! |
|
58 | follow_redirect! | |
59 | assert_equal issue, assigns(:issue) |
|
59 | assert_equal issue, assigns(:issue) | |
60 |
|
60 | |||
61 | # check issue attributes |
|
61 | # check issue attributes | |
62 | assert_equal 'jsmith', issue.author.login |
|
62 | assert_equal 'jsmith', issue.author.login | |
63 | assert_equal 1, issue.project.id |
|
63 | assert_equal 1, issue.project.id | |
64 | assert_equal 1, issue.status.id |
|
64 | assert_equal 1, issue.status.id | |
65 | end |
|
65 | end | |
66 |
|
66 | |||
|
67 | def test_update_issue_form | |||
|
68 | log_user('jsmith', 'jsmith') | |||
|
69 | post 'projects/ecookbook/issues/new', :issue => { :tracker_id => "2"} | |||
|
70 | assert_response :success | |||
|
71 | assert_tag 'select', | |||
|
72 | :attributes => {:name => 'issue[tracker_id]'}, | |||
|
73 | :child => {:tag => 'option', :attributes => {:value => '2', :selected => 'selected'}} | |||
|
74 | end | |||
|
75 | ||||
67 | # add then remove 2 attachments to an issue |
|
76 | # add then remove 2 attachments to an issue | |
68 | def test_issue_attachments |
|
77 | def test_issue_attachments | |
69 | log_user('jsmith', 'jsmith') |
|
78 | log_user('jsmith', 'jsmith') | |
70 | set_tmp_attachments_directory |
|
79 | set_tmp_attachments_directory | |
71 |
|
80 | |||
72 | put 'issues/1', |
|
81 | put 'issues/1', | |
73 | :notes => 'Some notes', |
|
82 | :notes => 'Some notes', | |
74 | :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'This is an attachment'}} |
|
83 | :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'This is an attachment'}} | |
75 | assert_redirected_to "/issues/1" |
|
84 | assert_redirected_to "/issues/1" | |
76 |
|
85 | |||
77 | # make sure attachment was saved |
|
86 | # make sure attachment was saved | |
78 | attachment = Issue.find(1).attachments.find_by_filename("testfile.txt") |
|
87 | attachment = Issue.find(1).attachments.find_by_filename("testfile.txt") | |
79 | assert_kind_of Attachment, attachment |
|
88 | assert_kind_of Attachment, attachment | |
80 | assert_equal Issue.find(1), attachment.container |
|
89 | assert_equal Issue.find(1), attachment.container | |
81 | assert_equal 'This is an attachment', attachment.description |
|
90 | assert_equal 'This is an attachment', attachment.description | |
82 | # verify the size of the attachment stored in db |
|
91 | # verify the size of the attachment stored in db | |
83 | #assert_equal file_data_1.length, attachment.filesize |
|
92 | #assert_equal file_data_1.length, attachment.filesize | |
84 | # verify that the attachment was written to disk |
|
93 | # verify that the attachment was written to disk | |
85 | assert File.exist?(attachment.diskfile) |
|
94 | assert File.exist?(attachment.diskfile) | |
86 |
|
95 | |||
87 | # remove the attachments |
|
96 | # remove the attachments | |
88 | Issue.find(1).attachments.each(&:destroy) |
|
97 | Issue.find(1).attachments.each(&:destroy) | |
89 | assert_equal 0, Issue.find(1).attachments.length |
|
98 | assert_equal 0, Issue.find(1).attachments.length | |
90 | end |
|
99 | end | |
91 |
|
100 | |||
92 | def test_other_formats_links_on_index |
|
101 | def test_other_formats_links_on_index | |
93 | get '/projects/ecookbook/issues' |
|
102 | get '/projects/ecookbook/issues' | |
94 |
|
103 | |||
95 | %w(Atom PDF CSV).each do |format| |
|
104 | %w(Atom PDF CSV).each do |format| | |
96 | assert_tag :a, :content => format, |
|
105 | assert_tag :a, :content => format, | |
97 | :attributes => { :href => "/projects/ecookbook/issues.#{format.downcase}", |
|
106 | :attributes => { :href => "/projects/ecookbook/issues.#{format.downcase}", | |
98 | :rel => 'nofollow' } |
|
107 | :rel => 'nofollow' } | |
99 | end |
|
108 | end | |
100 | end |
|
109 | end | |
101 |
|
110 | |||
102 | def test_other_formats_links_on_index_without_project_id_in_url |
|
111 | def test_other_formats_links_on_index_without_project_id_in_url | |
103 | get '/issues', :project_id => 'ecookbook' |
|
112 | get '/issues', :project_id => 'ecookbook' | |
104 |
|
113 | |||
105 | %w(Atom PDF CSV).each do |format| |
|
114 | %w(Atom PDF CSV).each do |format| | |
106 | assert_tag :a, :content => format, |
|
115 | assert_tag :a, :content => format, | |
107 | :attributes => { :href => "/projects/ecookbook/issues.#{format.downcase}", |
|
116 | :attributes => { :href => "/projects/ecookbook/issues.#{format.downcase}", | |
108 | :rel => 'nofollow' } |
|
117 | :rel => 'nofollow' } | |
109 | end |
|
118 | end | |
110 | end |
|
119 | end | |
111 |
|
120 | |||
112 | def test_pagination_links_on_index |
|
121 | def test_pagination_links_on_index | |
113 | Setting.per_page_options = '2' |
|
122 | Setting.per_page_options = '2' | |
114 | get '/projects/ecookbook/issues' |
|
123 | get '/projects/ecookbook/issues' | |
115 |
|
124 | |||
116 | assert_tag :a, :content => '2', |
|
125 | assert_tag :a, :content => '2', | |
117 | :attributes => { :href => '/projects/ecookbook/issues?page=2' } |
|
126 | :attributes => { :href => '/projects/ecookbook/issues?page=2' } | |
118 |
|
127 | |||
119 | end |
|
128 | end | |
120 |
|
129 | |||
121 | def test_pagination_links_on_index_without_project_id_in_url |
|
130 | def test_pagination_links_on_index_without_project_id_in_url | |
122 | Setting.per_page_options = '2' |
|
131 | Setting.per_page_options = '2' | |
123 | get '/issues', :project_id => 'ecookbook' |
|
132 | get '/issues', :project_id => 'ecookbook' | |
124 |
|
133 | |||
125 | assert_tag :a, :content => '2', |
|
134 | assert_tag :a, :content => '2', | |
126 | :attributes => { :href => '/projects/ecookbook/issues?page=2' } |
|
135 | :attributes => { :href => '/projects/ecookbook/issues?page=2' } | |
127 |
|
136 | |||
128 | end |
|
137 | end | |
129 |
|
138 | |||
130 | def test_issue_with_user_custom_field |
|
139 | def test_issue_with_user_custom_field | |
131 | @field = IssueCustomField.create!(:name => 'Tester', :field_format => 'user', :is_for_all => true, :trackers => Tracker.all) |
|
140 | @field = IssueCustomField.create!(:name => 'Tester', :field_format => 'user', :is_for_all => true, :trackers => Tracker.all) | |
132 | Role.anonymous.add_permission! :add_issues, :edit_issues |
|
141 | Role.anonymous.add_permission! :add_issues, :edit_issues | |
133 | users = Project.find(1).users |
|
142 | users = Project.find(1).users | |
134 | tester = users.first |
|
143 | tester = users.first | |
135 |
|
144 | |||
136 | # Issue form |
|
145 | # Issue form | |
137 | get '/projects/ecookbook/issues/new' |
|
146 | get '/projects/ecookbook/issues/new' | |
138 | assert_response :success |
|
147 | assert_response :success | |
139 | assert_tag :select, |
|
148 | assert_tag :select, | |
140 | :attributes => {:name => "issue[custom_field_values][#{@field.id}]"}, |
|
149 | :attributes => {:name => "issue[custom_field_values][#{@field.id}]"}, | |
141 | :children => {:count => (users.size + 1)}, # +1 for blank value |
|
150 | :children => {:count => (users.size + 1)}, # +1 for blank value | |
142 | :child => { |
|
151 | :child => { | |
143 | :tag => 'option', |
|
152 | :tag => 'option', | |
144 | :attributes => {:value => tester.id.to_s}, |
|
153 | :attributes => {:value => tester.id.to_s}, | |
145 | :content => tester.name |
|
154 | :content => tester.name | |
146 | } |
|
155 | } | |
147 |
|
156 | |||
148 | # Create issue |
|
157 | # Create issue | |
149 | assert_difference 'Issue.count' do |
|
158 | assert_difference 'Issue.count' do | |
150 | post '/projects/ecookbook/issues', |
|
159 | post '/projects/ecookbook/issues', | |
151 | :issue => { |
|
160 | :issue => { | |
152 | :tracker_id => '1', |
|
161 | :tracker_id => '1', | |
153 | :priority_id => '4', |
|
162 | :priority_id => '4', | |
154 | :subject => 'Issue with user custom field', |
|
163 | :subject => 'Issue with user custom field', | |
155 | :custom_field_values => {@field.id.to_s => users.first.id.to_s} |
|
164 | :custom_field_values => {@field.id.to_s => users.first.id.to_s} | |
156 | } |
|
165 | } | |
157 | end |
|
166 | end | |
158 | issue = Issue.first(:order => 'id DESC') |
|
167 | issue = Issue.first(:order => 'id DESC') | |
159 | assert_response 302 |
|
168 | assert_response 302 | |
160 |
|
169 | |||
161 | # Issue view |
|
170 | # Issue view | |
162 | follow_redirect! |
|
171 | follow_redirect! | |
163 | assert_tag :th, |
|
172 | assert_tag :th, | |
164 | :content => /Tester/, |
|
173 | :content => /Tester/, | |
165 | :sibling => { |
|
174 | :sibling => { | |
166 | :tag => 'td', |
|
175 | :tag => 'td', | |
167 | :content => tester.name |
|
176 | :content => tester.name | |
168 | } |
|
177 | } | |
169 | assert_tag :select, |
|
178 | assert_tag :select, | |
170 | :attributes => {:name => "issue[custom_field_values][#{@field.id}]"}, |
|
179 | :attributes => {:name => "issue[custom_field_values][#{@field.id}]"}, | |
171 | :children => {:count => (users.size + 1)}, # +1 for blank value |
|
180 | :children => {:count => (users.size + 1)}, # +1 for blank value | |
172 | :child => { |
|
181 | :child => { | |
173 | :tag => 'option', |
|
182 | :tag => 'option', | |
174 | :attributes => {:value => tester.id.to_s, :selected => 'selected'}, |
|
183 | :attributes => {:value => tester.id.to_s, :selected => 'selected'}, | |
175 | :content => tester.name |
|
184 | :content => tester.name | |
176 | } |
|
185 | } | |
177 |
|
186 | |||
178 | # Update issue |
|
187 | # Update issue | |
179 | new_tester = users[1] |
|
188 | new_tester = users[1] | |
180 | assert_difference 'Journal.count' do |
|
189 | assert_difference 'Journal.count' do | |
181 | put "/issues/#{issue.id}", |
|
190 | put "/issues/#{issue.id}", | |
182 | :notes => 'Updating custom field', |
|
191 | :notes => 'Updating custom field', | |
183 | :issue => { |
|
192 | :issue => { | |
184 | :custom_field_values => {@field.id.to_s => new_tester.id.to_s} |
|
193 | :custom_field_values => {@field.id.to_s => new_tester.id.to_s} | |
185 | } |
|
194 | } | |
186 | end |
|
195 | end | |
187 | assert_response 302 |
|
196 | assert_response 302 | |
188 |
|
197 | |||
189 | # Issue view |
|
198 | # Issue view | |
190 | follow_redirect! |
|
199 | follow_redirect! | |
191 | assert_tag :content => 'Tester', |
|
200 | assert_tag :content => 'Tester', | |
192 | :ancestor => {:tag => 'ul', :attributes => {:class => /details/}}, |
|
201 | :ancestor => {:tag => 'ul', :attributes => {:class => /details/}}, | |
193 | :sibling => { |
|
202 | :sibling => { | |
194 | :content => tester.name, |
|
203 | :content => tester.name, | |
195 | :sibling => { |
|
204 | :sibling => { | |
196 | :content => new_tester.name |
|
205 | :content => new_tester.name | |
197 | } |
|
206 | } | |
198 | } |
|
207 | } | |
199 | end |
|
208 | end | |
200 | end |
|
209 | end |
@@ -1,456 +1,458 | |||||
1 | # Redmine - project management software |
|
1 | # Redmine - project management software | |
2 | # Copyright (C) 2006-2011 Jean-Philippe Lang |
|
2 | # Copyright (C) 2006-2011 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.expand_path('../../test_helper', __FILE__) |
|
18 | require File.expand_path('../../test_helper', __FILE__) | |
19 |
|
19 | |||
20 | class RoutingTest < ActionController::IntegrationTest |
|
20 | class RoutingTest < ActionController::IntegrationTest | |
21 | 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.xml", :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml' |
|
28 | should_route :get, "/attachments/1.xml", :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml' | |
29 | should_route :get, "/attachments/1.json", :controller => 'attachments', :action => 'show', :id => '1', :format => 'json' |
|
29 | should_route :get, "/attachments/1.json", :controller => 'attachments', :action => 'show', :id => '1', :format => 'json' | |
30 | should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext' |
|
30 | should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext' | |
31 | should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1' |
|
31 | should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1' | |
32 | should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext' |
|
32 | should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext' | |
33 | end |
|
33 | end | |
34 |
|
34 | |||
35 | context "boards" do |
|
35 | context "boards" do | |
36 | should_route :get, "/projects/world_domination/boards", :controller => 'boards', :action => 'index', :project_id => 'world_domination' |
|
36 | should_route :get, "/projects/world_domination/boards", :controller => 'boards', :action => 'index', :project_id => 'world_domination' | |
37 | should_route :get, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination' |
|
37 | should_route :get, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination' | |
38 | should_route :get, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44' |
|
38 | should_route :get, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44' | |
39 | should_route :get, "/projects/world_domination/boards/44.atom", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44', :format => 'atom' |
|
39 | should_route :get, "/projects/world_domination/boards/44.atom", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44', :format => 'atom' | |
40 | should_route :get, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44' |
|
40 | should_route :get, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44' | |
41 |
|
41 | |||
42 | should_route :post, "/projects/world_domination/boards", :controller => 'boards', :action => 'create', :project_id => 'world_domination' |
|
42 | should_route :post, "/projects/world_domination/boards", :controller => 'boards', :action => 'create', :project_id => 'world_domination' | |
43 | should_route :put, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'update', :project_id => 'world_domination', :id => '44' |
|
43 | should_route :put, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'update', :project_id => 'world_domination', :id => '44' | |
44 | should_route :delete, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44' |
|
44 | should_route :delete, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44' | |
45 |
|
45 | |||
46 | end |
|
46 | end | |
47 |
|
47 | |||
48 | context "custom_fields" do |
|
48 | context "custom_fields" do | |
49 | should_route :get, "/custom_fields", :controller => 'custom_fields', :action => 'index' |
|
49 | should_route :get, "/custom_fields", :controller => 'custom_fields', :action => 'index' | |
50 | should_route :get, "/custom_fields/new", :controller => 'custom_fields', :action => 'new' |
|
50 | should_route :get, "/custom_fields/new", :controller => 'custom_fields', :action => 'new' | |
51 | should_route :post, "/custom_fields", :controller => 'custom_fields', :action => 'create' |
|
51 | should_route :post, "/custom_fields", :controller => 'custom_fields', :action => 'create' | |
52 | should_route :get, "/custom_fields/2/edit", :controller => 'custom_fields', :action => 'edit', :id => 2 |
|
52 | should_route :get, "/custom_fields/2/edit", :controller => 'custom_fields', :action => 'edit', :id => 2 | |
53 | should_route :put, "/custom_fields/2", :controller => 'custom_fields', :action => 'update', :id => 2 |
|
53 | should_route :put, "/custom_fields/2", :controller => 'custom_fields', :action => 'update', :id => 2 | |
54 | should_route :delete, "/custom_fields/2", :controller => 'custom_fields', :action => 'destroy', :id => 2 |
|
54 | should_route :delete, "/custom_fields/2", :controller => 'custom_fields', :action => 'destroy', :id => 2 | |
55 | end |
|
55 | end | |
56 |
|
56 | |||
57 | context "documents" do |
|
57 | context "documents" do | |
58 | should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567' |
|
58 | should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567' | |
59 | should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567' |
|
59 | should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567' | |
60 | should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22' |
|
60 | should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22' | |
61 | should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22' |
|
61 | should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22' | |
62 |
|
62 | |||
63 | should_route :post, "/projects/567/documents", :controller => 'documents', :action => 'create', :project_id => '567' |
|
63 | should_route :post, "/projects/567/documents", :controller => 'documents', :action => 'create', :project_id => '567' | |
64 | should_route :put, "/documents/22", :controller => 'documents', :action => 'update', :id => '22' |
|
64 | should_route :put, "/documents/22", :controller => 'documents', :action => 'update', :id => '22' | |
65 | should_route :delete, "/documents/22", :controller => 'documents', :action => 'destroy', :id => '22' |
|
65 | should_route :delete, "/documents/22", :controller => 'documents', :action => 'destroy', :id => '22' | |
66 |
|
66 | |||
67 | should_route :post, "/documents/22/add_attachment", :controller => 'documents', :action => 'add_attachment', :id => '22' |
|
67 | should_route :post, "/documents/22/add_attachment", :controller => 'documents', :action => 'add_attachment', :id => '22' | |
68 | end |
|
68 | end | |
69 |
|
69 | |||
70 | context "roles" do |
|
70 | context "roles" do | |
71 | should_route :get, "/enumerations", :controller => 'enumerations', :action => 'index' |
|
71 | should_route :get, "/enumerations", :controller => 'enumerations', :action => 'index' | |
72 | should_route :get, "/enumerations/new", :controller => 'enumerations', :action => 'new' |
|
72 | should_route :get, "/enumerations/new", :controller => 'enumerations', :action => 'new' | |
73 | should_route :post, "/enumerations", :controller => 'enumerations', :action => 'create' |
|
73 | should_route :post, "/enumerations", :controller => 'enumerations', :action => 'create' | |
74 | should_route :get, "/enumerations/2/edit", :controller => 'enumerations', :action => 'edit', :id => 2 |
|
74 | should_route :get, "/enumerations/2/edit", :controller => 'enumerations', :action => 'edit', :id => 2 | |
75 | should_route :put, "/enumerations/2", :controller => 'enumerations', :action => 'update', :id => 2 |
|
75 | should_route :put, "/enumerations/2", :controller => 'enumerations', :action => 'update', :id => 2 | |
76 | should_route :delete, "/enumerations/2", :controller => 'enumerations', :action => 'destroy', :id => 2 |
|
76 | should_route :delete, "/enumerations/2", :controller => 'enumerations', :action => 'destroy', :id => 2 | |
77 | end |
|
77 | end | |
78 |
|
78 | |||
79 | context "groups" do |
|
79 | context "groups" do | |
80 | should_route :post, "/groups/567/users", :controller => 'groups', :action => 'add_users', :id => '567' |
|
80 | should_route :post, "/groups/567/users", :controller => 'groups', :action => 'add_users', :id => '567' | |
81 | should_route :delete, "/groups/567/users/12", :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12' |
|
81 | should_route :delete, "/groups/567/users/12", :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12' | |
82 | end |
|
82 | end | |
83 |
|
83 | |||
84 | context "issues" do |
|
84 | context "issues" do | |
85 | # REST actions |
|
85 | # REST actions | |
86 | should_route :get, "/issues", :controller => 'issues', :action => 'index' |
|
86 | should_route :get, "/issues", :controller => 'issues', :action => 'index' | |
87 | should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf' |
|
87 | should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf' | |
88 | should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom' |
|
88 | should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom' | |
89 | should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml' |
|
89 | should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml' | |
90 | should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23' |
|
90 | should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23' | |
91 | should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf' |
|
91 | should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf' | |
92 | should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom' |
|
92 | should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom' | |
93 | should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml' |
|
93 | should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml' | |
94 | should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64' |
|
94 | should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64' | |
95 | should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf' |
|
95 | should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf' | |
96 | should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom' |
|
96 | should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom' | |
97 | should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml' |
|
97 | should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml' | |
98 |
|
98 | |||
99 | should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23' |
|
99 | should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23' | |
|
100 | # issue form update | |||
|
101 | should_route :post, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23' | |||
100 | should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23' |
|
102 | should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23' | |
101 | should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml' |
|
103 | should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml' | |
102 |
|
104 | |||
103 | should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64' |
|
105 | should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64' | |
104 | should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml' |
|
106 | should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml' | |
105 |
|
107 | |||
106 | should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml' |
|
108 | should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml' | |
107 |
|
109 | |||
108 | # Extra actions |
|
110 | # Extra actions | |
109 | should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64' |
|
111 | should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64' | |
110 |
|
112 | |||
111 | should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new' |
|
113 | should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new' | |
112 | should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create' |
|
114 | should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create' | |
113 |
|
115 | |||
114 | should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1' |
|
116 | should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1' | |
115 |
|
117 | |||
116 | should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show' |
|
118 | should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show' | |
117 | should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name' |
|
119 | should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name' | |
118 |
|
120 | |||
119 | should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show' |
|
121 | should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show' | |
120 | should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf' |
|
122 | should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf' | |
121 | should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name' |
|
123 | should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name' | |
122 | should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf' |
|
124 | should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf' | |
123 |
|
125 | |||
124 | should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues' |
|
126 | should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues' | |
125 |
|
127 | |||
126 | should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' |
|
128 | should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' | |
127 | should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' |
|
129 | should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' | |
128 | should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' |
|
130 | should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' | |
129 | should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' |
|
131 | should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' | |
130 |
|
132 | |||
131 | should_route :get, "/issues/changes", :controller => 'journals', :action => 'index' |
|
133 | should_route :get, "/issues/changes", :controller => 'journals', :action => 'index' | |
132 |
|
134 | |||
133 | should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit' |
|
135 | should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit' | |
134 | should_route :post, "/issues/bulk_update", :controller => 'issues', :action => 'bulk_update' |
|
136 | should_route :post, "/issues/bulk_update", :controller => 'issues', :action => 'bulk_update' | |
135 | end |
|
137 | end | |
136 |
|
138 | |||
137 | context "issue categories" do |
|
139 | context "issue categories" do | |
138 | should_route :get, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'index', :project_id => 'foo' |
|
140 | should_route :get, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'index', :project_id => 'foo' | |
139 | should_route :get, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'xml' |
|
141 | should_route :get, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'xml' | |
140 | should_route :get, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'json' |
|
142 | should_route :get, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'json' | |
141 |
|
143 | |||
142 | should_route :get, "/projects/foo/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'foo' |
|
144 | should_route :get, "/projects/foo/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'foo' | |
143 |
|
145 | |||
144 | should_route :post, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'create', :project_id => 'foo' |
|
146 | should_route :post, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'create', :project_id => 'foo' | |
145 | should_route :post, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'xml' |
|
147 | should_route :post, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'xml' | |
146 | should_route :post, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'json' |
|
148 | should_route :post, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'json' | |
147 |
|
149 | |||
148 | should_route :get, "/issue_categories/1", :controller => 'issue_categories', :action => 'show', :id => '1' |
|
150 | should_route :get, "/issue_categories/1", :controller => 'issue_categories', :action => 'show', :id => '1' | |
149 | should_route :get, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'xml' |
|
151 | should_route :get, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'xml' | |
150 | should_route :get, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'json' |
|
152 | should_route :get, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'json' | |
151 |
|
153 | |||
152 | should_route :get, "/issue_categories/1/edit", :controller => 'issue_categories', :action => 'edit', :id => '1' |
|
154 | should_route :get, "/issue_categories/1/edit", :controller => 'issue_categories', :action => 'edit', :id => '1' | |
153 |
|
155 | |||
154 | should_route :put, "/issue_categories/1", :controller => 'issue_categories', :action => 'update', :id => '1' |
|
156 | should_route :put, "/issue_categories/1", :controller => 'issue_categories', :action => 'update', :id => '1' | |
155 | should_route :put, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'xml' |
|
157 | should_route :put, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'xml' | |
156 | should_route :put, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'json' |
|
158 | should_route :put, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'json' | |
157 |
|
159 | |||
158 | should_route :delete, "/issue_categories/1", :controller => 'issue_categories', :action => 'destroy', :id => '1' |
|
160 | should_route :delete, "/issue_categories/1", :controller => 'issue_categories', :action => 'destroy', :id => '1' | |
159 | should_route :delete, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'xml' |
|
161 | should_route :delete, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'xml' | |
160 | should_route :delete, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'json' |
|
162 | should_route :delete, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'json' | |
161 | end |
|
163 | end | |
162 |
|
164 | |||
163 | context "issue relations" do |
|
165 | context "issue relations" do | |
164 | should_route :get, "/issues/1/relations", :controller => 'issue_relations', :action => 'index', :issue_id => '1' |
|
166 | should_route :get, "/issues/1/relations", :controller => 'issue_relations', :action => 'index', :issue_id => '1' | |
165 | should_route :get, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'xml' |
|
167 | should_route :get, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'xml' | |
166 | should_route :get, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'json' |
|
168 | should_route :get, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'json' | |
167 |
|
169 | |||
168 | should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'create', :issue_id => '1' |
|
170 | should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'create', :issue_id => '1' | |
169 | should_route :post, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'xml' |
|
171 | should_route :post, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'xml' | |
170 | should_route :post, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'json' |
|
172 | should_route :post, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'json' | |
171 |
|
173 | |||
172 | should_route :get, "/relations/23", :controller => 'issue_relations', :action => 'show', :id => '23' |
|
174 | should_route :get, "/relations/23", :controller => 'issue_relations', :action => 'show', :id => '23' | |
173 | should_route :get, "/relations/23.xml", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'xml' |
|
175 | should_route :get, "/relations/23.xml", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'xml' | |
174 | should_route :get, "/relations/23.json", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'json' |
|
176 | should_route :get, "/relations/23.json", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'json' | |
175 |
|
177 | |||
176 | should_route :delete, "/relations/23", :controller => 'issue_relations', :action => 'destroy', :id => '23' |
|
178 | should_route :delete, "/relations/23", :controller => 'issue_relations', :action => 'destroy', :id => '23' | |
177 | should_route :delete, "/relations/23.xml", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'xml' |
|
179 | should_route :delete, "/relations/23.xml", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'xml' | |
178 | should_route :delete, "/relations/23.json", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'json' |
|
180 | should_route :delete, "/relations/23.json", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'json' | |
179 | end |
|
181 | end | |
180 |
|
182 | |||
181 | context "issue reports" do |
|
183 | context "issue reports" do | |
182 | should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567' |
|
184 | should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567' | |
183 | should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to' |
|
185 | should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to' | |
184 | end |
|
186 | end | |
185 |
|
187 | |||
186 | context "members" do |
|
188 | context "members" do | |
187 | should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234' |
|
189 | should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234' | |
188 | end |
|
190 | end | |
189 |
|
191 | |||
190 | context "messages" do |
|
192 | context "messages" do | |
191 | should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22' |
|
193 | should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22' | |
192 | should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' |
|
194 | should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' | |
193 | should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' |
|
195 | should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' | |
194 |
|
196 | |||
195 | should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' |
|
197 | should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' | |
196 | should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' |
|
198 | should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' | |
197 | should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22' |
|
199 | should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22' | |
198 | should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22' |
|
200 | should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22' | |
199 | end |
|
201 | end | |
200 |
|
202 | |||
201 | context "news" do |
|
203 | context "news" do | |
202 | should_route :get, "/news", :controller => 'news', :action => 'index' |
|
204 | should_route :get, "/news", :controller => 'news', :action => 'index' | |
203 | should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom' |
|
205 | should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom' | |
204 | should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml' |
|
206 | should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml' | |
205 | should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json' |
|
207 | should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json' | |
206 | should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567' |
|
208 | should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567' | |
207 | should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567' |
|
209 | should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567' | |
208 | should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567' |
|
210 | should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567' | |
209 | should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567' |
|
211 | should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567' | |
210 | should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2' |
|
212 | should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2' | |
211 | should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567' |
|
213 | should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567' | |
212 | should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234' |
|
214 | should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234' | |
213 | should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567' |
|
215 | should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567' | |
214 | should_route :get, "/news/preview", :controller => 'previews', :action => 'news' |
|
216 | should_route :get, "/news/preview", :controller => 'previews', :action => 'news' | |
215 |
|
217 | |||
216 | should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567' |
|
218 | should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567' | |
217 | should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567' |
|
219 | should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567' | |
218 |
|
220 | |||
219 | should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567' |
|
221 | should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567' | |
220 |
|
222 | |||
221 | should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567' |
|
223 | should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567' | |
222 | should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15' |
|
224 | should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15' | |
223 | end |
|
225 | end | |
224 |
|
226 | |||
225 | context "projects" do |
|
227 | context "projects" do | |
226 | should_route :get, "/projects", :controller => 'projects', :action => 'index' |
|
228 | should_route :get, "/projects", :controller => 'projects', :action => 'index' | |
227 | should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom' |
|
229 | should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom' | |
228 | should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml' |
|
230 | should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml' | |
229 | should_route :get, "/projects/new", :controller => 'projects', :action => 'new' |
|
231 | should_route :get, "/projects/new", :controller => 'projects', :action => 'new' | |
230 | should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test' |
|
232 | should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test' | |
231 | should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml' |
|
233 | should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml' | |
232 | should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223' |
|
234 | should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223' | |
233 | should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members' |
|
235 | should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members' | |
234 | should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33' |
|
236 | should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33' | |
235 | should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33' |
|
237 | should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33' | |
236 | should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33' |
|
238 | should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33' | |
237 | should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33' |
|
239 | should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33' | |
238 | should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom' |
|
240 | should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom' | |
239 |
|
241 | |||
240 | should_route :post, "/projects", :controller => 'projects', :action => 'create' |
|
242 | should_route :post, "/projects", :controller => 'projects', :action => 'create' | |
241 | should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml' |
|
243 | should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml' | |
242 | should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33' |
|
244 | should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33' | |
243 | should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64' |
|
245 | should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64' | |
244 | should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64' |
|
246 | should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64' | |
245 |
|
247 | |||
246 | should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64' |
|
248 | should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64' | |
247 | should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223' |
|
249 | should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223' | |
248 | should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml' |
|
250 | should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml' | |
249 |
|
251 | |||
250 | should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64' |
|
252 | should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64' | |
251 | should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml' |
|
253 | should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml' | |
252 | should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64' |
|
254 | should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64' | |
253 | end |
|
255 | end | |
254 |
|
256 | |||
255 | context "queries" do |
|
257 | context "queries" do | |
256 | should_route :get, "/queries.xml", :controller => 'queries', :action => 'index', :format => 'xml' |
|
258 | should_route :get, "/queries.xml", :controller => 'queries', :action => 'index', :format => 'xml' | |
257 | should_route :get, "/queries.json", :controller => 'queries', :action => 'index', :format => 'json' |
|
259 | should_route :get, "/queries.json", :controller => 'queries', :action => 'index', :format => 'json' | |
258 |
|
260 | |||
259 | should_route :get, "/queries/new", :controller => 'queries', :action => 'new' |
|
261 | should_route :get, "/queries/new", :controller => 'queries', :action => 'new' | |
260 | should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine' |
|
262 | should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine' | |
261 |
|
263 | |||
262 | should_route :post, "/queries", :controller => 'queries', :action => 'create' |
|
264 | should_route :post, "/queries", :controller => 'queries', :action => 'create' | |
263 | should_route :post, "/projects/redmine/queries", :controller => 'queries', :action => 'create', :project_id => 'redmine' |
|
265 | should_route :post, "/projects/redmine/queries", :controller => 'queries', :action => 'create', :project_id => 'redmine' | |
264 |
|
266 | |||
265 | should_route :get, "/queries/1/edit", :controller => 'queries', :action => 'edit', :id => '1' |
|
267 | should_route :get, "/queries/1/edit", :controller => 'queries', :action => 'edit', :id => '1' | |
266 |
|
268 | |||
267 | should_route :put, "/queries/1", :controller => 'queries', :action => 'update', :id => '1' |
|
269 | should_route :put, "/queries/1", :controller => 'queries', :action => 'update', :id => '1' | |
268 |
|
270 | |||
269 | should_route :delete, "/queries/1", :controller => 'queries', :action => 'destroy', :id => '1' |
|
271 | should_route :delete, "/queries/1", :controller => 'queries', :action => 'destroy', :id => '1' | |
270 | end |
|
272 | end | |
271 |
|
273 | |||
272 | context "repositories" do |
|
274 | context "repositories" do | |
273 | should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine' |
|
275 | should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine' | |
274 | should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' |
|
276 | should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' | |
275 | should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine' |
|
277 | should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine' | |
276 | should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom' |
|
278 | should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom' | |
277 | should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457' |
|
279 | should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457' | |
278 | should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457' |
|
280 | should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457' | |
279 | should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff' |
|
281 | should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff' | |
280 | should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c] |
|
282 | should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c] | |
281 | 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' |
|
283 | 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' | |
282 | should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c] |
|
284 | should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c] | |
283 | should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c] |
|
285 | should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c] | |
284 | 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' |
|
286 | 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' | |
285 | 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' |
|
287 | 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' | |
286 | 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' |
|
288 | 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' | |
287 | should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c] |
|
289 | should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c] | |
288 | should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c] |
|
290 | should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c] | |
289 | should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine' |
|
291 | should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine' | |
290 |
|
292 | |||
291 | should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' |
|
293 | should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' | |
292 | end |
|
294 | end | |
293 |
|
295 | |||
294 | context "roles" do |
|
296 | context "roles" do | |
295 | should_route :get, "/roles", :controller => 'roles', :action => 'index' |
|
297 | should_route :get, "/roles", :controller => 'roles', :action => 'index' | |
296 | should_route :get, "/roles/new", :controller => 'roles', :action => 'new' |
|
298 | should_route :get, "/roles/new", :controller => 'roles', :action => 'new' | |
297 | should_route :post, "/roles", :controller => 'roles', :action => 'create' |
|
299 | should_route :post, "/roles", :controller => 'roles', :action => 'create' | |
298 | should_route :get, "/roles/2/edit", :controller => 'roles', :action => 'edit', :id => 2 |
|
300 | should_route :get, "/roles/2/edit", :controller => 'roles', :action => 'edit', :id => 2 | |
299 | should_route :put, "/roles/2", :controller => 'roles', :action => 'update', :id => 2 |
|
301 | should_route :put, "/roles/2", :controller => 'roles', :action => 'update', :id => 2 | |
300 | should_route :delete, "/roles/2", :controller => 'roles', :action => 'destroy', :id => 2 |
|
302 | should_route :delete, "/roles/2", :controller => 'roles', :action => 'destroy', :id => 2 | |
301 | should_route :get, "/roles/permissions", :controller => 'roles', :action => 'permissions' |
|
303 | should_route :get, "/roles/permissions", :controller => 'roles', :action => 'permissions' | |
302 | should_route :post, "/roles/permissions", :controller => 'roles', :action => 'permissions' |
|
304 | should_route :post, "/roles/permissions", :controller => 'roles', :action => 'permissions' | |
303 | end |
|
305 | end | |
304 |
|
306 | |||
305 | context "timelogs (global)" do |
|
307 | context "timelogs (global)" do | |
306 | should_route :get, "/time_entries", :controller => 'timelog', :action => 'index' |
|
308 | should_route :get, "/time_entries", :controller => 'timelog', :action => 'index' | |
307 | should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv' |
|
309 | should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv' | |
308 | should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom' |
|
310 | should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom' | |
309 | should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new' |
|
311 | should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new' | |
310 | should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22' |
|
312 | should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22' | |
311 |
|
313 | |||
312 | should_route :post, "/time_entries", :controller => 'timelog', :action => 'create' |
|
314 | should_route :post, "/time_entries", :controller => 'timelog', :action => 'create' | |
313 |
|
315 | |||
314 | should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22' |
|
316 | should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22' | |
315 |
|
317 | |||
316 | should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55' |
|
318 | should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55' | |
317 | end |
|
319 | end | |
318 |
|
320 | |||
319 | context "timelogs (scoped under project)" do |
|
321 | context "timelogs (scoped under project)" do | |
320 | should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567' |
|
322 | should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567' | |
321 | should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv' |
|
323 | should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv' | |
322 | should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom' |
|
324 | should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom' | |
323 | should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567' |
|
325 | should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567' | |
324 | should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567' |
|
326 | should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567' | |
325 |
|
327 | |||
326 | should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567' |
|
328 | should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567' | |
327 |
|
329 | |||
328 | should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567' |
|
330 | should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567' | |
329 |
|
331 | |||
330 | should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567' |
|
332 | should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567' | |
331 | end |
|
333 | end | |
332 |
|
334 | |||
333 | context "timelogs (scoped under issues)" do |
|
335 | context "timelogs (scoped under issues)" do | |
334 | should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234' |
|
336 | should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234' | |
335 | should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv' |
|
337 | should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv' | |
336 | should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom' |
|
338 | should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom' | |
337 | should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234' |
|
339 | should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234' | |
338 | should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234' |
|
340 | should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234' | |
339 |
|
341 | |||
340 | should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234' |
|
342 | should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234' | |
341 |
|
343 | |||
342 | should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234' |
|
344 | should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234' | |
343 |
|
345 | |||
344 | should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234' |
|
346 | should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234' | |
345 | end |
|
347 | end | |
346 |
|
348 | |||
347 | context "timelogs (scoped under project and issues)" do |
|
349 | context "timelogs (scoped under project and issues)" do | |
348 | should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook' |
|
350 | should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook' | |
349 | should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv' |
|
351 | should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv' | |
350 | should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom' |
|
352 | should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom' | |
351 | should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook' |
|
353 | should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook' | |
352 | should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook' |
|
354 | should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook' | |
353 |
|
355 | |||
354 | should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook' |
|
356 | should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook' | |
355 |
|
357 | |||
356 | should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook' |
|
358 | should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook' | |
357 |
|
359 | |||
358 | should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook' |
|
360 | should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook' | |
359 |
|
361 | |||
360 | should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report' |
|
362 | should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report' | |
361 | should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567' |
|
363 | should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567' | |
362 | should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv' |
|
364 | should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv' | |
363 | end |
|
365 | end | |
364 |
|
366 | |||
365 | context "users" do |
|
367 | context "users" do | |
366 | should_route :get, "/users", :controller => 'users', :action => 'index' |
|
368 | should_route :get, "/users", :controller => 'users', :action => 'index' | |
367 | should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml' |
|
369 | should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml' | |
368 | should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44' |
|
370 | should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44' | |
369 | should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml' |
|
371 | should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml' | |
370 | should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current' |
|
372 | should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current' | |
371 | should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml' |
|
373 | should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml' | |
372 | should_route :get, "/users/new", :controller => 'users', :action => 'new' |
|
374 | should_route :get, "/users/new", :controller => 'users', :action => 'new' | |
373 | should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444' |
|
375 | should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444' | |
374 |
|
376 | |||
375 | should_route :post, "/users", :controller => 'users', :action => 'create' |
|
377 | should_route :post, "/users", :controller => 'users', :action => 'create' | |
376 | should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml' |
|
378 | should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml' | |
377 |
|
379 | |||
378 | should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444' |
|
380 | should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444' | |
379 | should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml' |
|
381 | should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml' | |
380 |
|
382 | |||
381 | should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44' |
|
383 | should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44' | |
382 | should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml' |
|
384 | should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml' | |
383 |
|
385 | |||
384 | should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123' |
|
386 | should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123' | |
385 | should_route :put, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55' |
|
387 | should_route :put, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55' | |
386 | should_route :delete, "/users/123/memberships/55", :controller => 'users', :action => 'destroy_membership', :id => '123', :membership_id => '55' |
|
388 | should_route :delete, "/users/123/memberships/55", :controller => 'users', :action => 'destroy_membership', :id => '123', :membership_id => '55' | |
387 | end |
|
389 | end | |
388 |
|
390 | |||
389 | context "versions" do |
|
391 | context "versions" do | |
390 | # /projects/foo/versions is /projects/foo/roadmap |
|
392 | # /projects/foo/versions is /projects/foo/roadmap | |
391 | should_route :get, "/projects/foo/versions.xml", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'xml' |
|
393 | should_route :get, "/projects/foo/versions.xml", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'xml' | |
392 | should_route :get, "/projects/foo/versions.json", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'json' |
|
394 | should_route :get, "/projects/foo/versions.json", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'json' | |
393 |
|
395 | |||
394 | should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo' |
|
396 | should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo' | |
395 |
|
397 | |||
396 | should_route :post, "/projects/foo/versions", :controller => 'versions', :action => 'create', :project_id => 'foo' |
|
398 | should_route :post, "/projects/foo/versions", :controller => 'versions', :action => 'create', :project_id => 'foo' | |
397 | should_route :post, "/projects/foo/versions.xml", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'xml' |
|
399 | should_route :post, "/projects/foo/versions.xml", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'xml' | |
398 | should_route :post, "/projects/foo/versions.json", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'json' |
|
400 | should_route :post, "/projects/foo/versions.json", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'json' | |
399 |
|
401 | |||
400 | should_route :get, "/versions/1", :controller => 'versions', :action => 'show', :id => '1' |
|
402 | should_route :get, "/versions/1", :controller => 'versions', :action => 'show', :id => '1' | |
401 | should_route :get, "/versions/1.xml", :controller => 'versions', :action => 'show', :id => '1', :format => 'xml' |
|
403 | should_route :get, "/versions/1.xml", :controller => 'versions', :action => 'show', :id => '1', :format => 'xml' | |
402 | should_route :get, "/versions/1.json", :controller => 'versions', :action => 'show', :id => '1', :format => 'json' |
|
404 | should_route :get, "/versions/1.json", :controller => 'versions', :action => 'show', :id => '1', :format => 'json' | |
403 |
|
405 | |||
404 | should_route :get, "/versions/1/edit", :controller => 'versions', :action => 'edit', :id => '1' |
|
406 | should_route :get, "/versions/1/edit", :controller => 'versions', :action => 'edit', :id => '1' | |
405 |
|
407 | |||
406 | should_route :put, "/versions/1", :controller => 'versions', :action => 'update', :id => '1' |
|
408 | should_route :put, "/versions/1", :controller => 'versions', :action => 'update', :id => '1' | |
407 | should_route :put, "/versions/1.xml", :controller => 'versions', :action => 'update', :id => '1', :format => 'xml' |
|
409 | should_route :put, "/versions/1.xml", :controller => 'versions', :action => 'update', :id => '1', :format => 'xml' | |
408 | should_route :put, "/versions/1.json", :controller => 'versions', :action => 'update', :id => '1', :format => 'json' |
|
410 | should_route :put, "/versions/1.json", :controller => 'versions', :action => 'update', :id => '1', :format => 'json' | |
409 |
|
411 | |||
410 | should_route :delete, "/versions/1", :controller => 'versions', :action => 'destroy', :id => '1' |
|
412 | should_route :delete, "/versions/1", :controller => 'versions', :action => 'destroy', :id => '1' | |
411 | should_route :delete, "/versions/1.xml", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'xml' |
|
413 | should_route :delete, "/versions/1.xml", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'xml' | |
412 | should_route :delete, "/versions/1.json", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'json' |
|
414 | should_route :delete, "/versions/1.json", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'json' | |
413 |
|
415 | |||
414 | should_route :put, "/projects/foo/versions/close_completed", :controller => 'versions', :action => 'close_completed', :project_id => 'foo' |
|
416 | should_route :put, "/projects/foo/versions/close_completed", :controller => 'versions', :action => 'close_completed', :project_id => 'foo' | |
415 | should_route :post, "/versions/1/status_by", :controller => 'versions', :action => 'status_by', :id => '1' |
|
417 | should_route :post, "/versions/1/status_by", :controller => 'versions', :action => 'status_by', :id => '1' | |
416 | end |
|
418 | end | |
417 |
|
419 | |||
418 | context "welcome" do |
|
420 | context "welcome" do | |
419 | should_route :get, "/robots.txt", :controller => 'welcome', :action => 'robots' |
|
421 | should_route :get, "/robots.txt", :controller => 'welcome', :action => 'robots' | |
420 | end |
|
422 | end | |
421 |
|
423 | |||
422 | context "wiki (singular, project's pages)" do |
|
424 | context "wiki (singular, project's pages)" do | |
423 | should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567' |
|
425 | should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567' | |
424 | should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala' |
|
426 | should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala' | |
425 | should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page' |
|
427 | should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page' | |
426 | should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation' |
|
428 | should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation' | |
427 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation' |
|
429 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation' | |
428 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2' |
|
430 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2' | |
429 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2', :version_from => '1' |
|
431 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2', :version_from => '1' | |
430 | should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2' |
|
432 | should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2' | |
431 | should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' |
|
433 | should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' | |
432 | should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567' |
|
434 | should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567' | |
433 | should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567' |
|
435 | should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567' | |
434 | should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567' |
|
436 | should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567' | |
435 |
|
437 | |||
436 | should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation' |
|
438 | should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation' | |
437 | should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' |
|
439 | should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' | |
438 | should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida' |
|
440 | should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida' | |
439 | should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida' |
|
441 | should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida' | |
440 |
|
442 | |||
441 | should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page' |
|
443 | should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page' | |
442 |
|
444 | |||
443 | should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida' |
|
445 | should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida' | |
444 | end |
|
446 | end | |
445 |
|
447 | |||
446 | context "wikis (plural, admin setup)" do |
|
448 | context "wikis (plural, admin setup)" do | |
447 | should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida' |
|
449 | should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida' | |
448 |
|
450 | |||
449 | should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida' |
|
451 | should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida' | |
450 | should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida' |
|
452 | should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida' | |
451 | end |
|
453 | end | |
452 |
|
454 | |||
453 | context "administration panel" do |
|
455 | context "administration panel" do | |
454 | should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects' |
|
456 | should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects' | |
455 | end |
|
457 | end | |
456 | end |
|
458 | end |
General Comments 0
You need to be logged in to leave comments.
Login now