<h2><%= l(:label_spent_time) %></h2>
-<%= labelled_form_for @time_entry, :url => project_time_entry_path(@time_entry.project, @time_entry) do |f| %>
+<%= labelled_form_for @time_entry, :url => time_entry_path(@time_entry) do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<%= submit_tag l(:button_save) %>
<% end %>
get 'versions', :to => 'versions#index'
resources :news, :except => [:show, :edit, :update, :destroy]
- resources :time_entries, :controller => 'timelog' do
+ resources :time_entries, :controller => 'timelog', :except => [:show, :edit, :update, :destroy] do
get 'report', :on => :collection
end
resources :queries, :only => [:new, :create]
match 'bulk_edit', :via => [:get, :post]
post 'bulk_update'
end
- resources :time_entries, :controller => 'timelog' do
+ resources :time_entries, :controller => 'timelog', :except => [:show, :edit, :update, :destroy] do
collection do
get 'report'
end
get :edit, :id => 2, :project_id => nil
assert_response :success
assert_template 'edit'
- # Default activity selected
- assert_tag :tag => 'form', :attributes => { :action => '/projects/ecookbook/time_entries/2' }
+ assert_tag :tag => 'form', :attributes => { :action => '/time_entries/2' }
end
def test_get_edit_with_an_existing_time_entry_with_inactive_activity
should_route 'GET /projects/foo/time_entries.atom' => 'timelog#index', :project_id => 'foo', :format => 'atom'
should_route 'GET /projects/foo/time_entries/new' => 'timelog#new', :project_id => 'foo'
should_route 'POST /projects/foo/time_entries' => 'timelog#create', :project_id => 'foo'
-
- # TODO: unused?
- should_route 'GET /projects/foo/time_entries/22/edit' => 'timelog#edit', :project_id => 'foo', :id => '22'
- should_route 'PUT /projects/foo/time_entries/22' => 'timelog#update', :project_id => 'foo', :id => '22'
- should_route 'DELETE /projects/foo/time_entries/22' => 'timelog#destroy', :project_id => 'foo', :id => '22'
end
def test_timelogs_scoped_under_issues
should_route 'GET /issues/234/time_entries.atom' => 'timelog#index', :issue_id => '234', :format => 'atom'
should_route 'GET /issues/234/time_entries/new' => 'timelog#new', :issue_id => '234'
should_route 'POST /issues/234/time_entries' => 'timelog#create', :issue_id => '234'
-
- # TODO: unused?
- should_route 'GET /issues/234/time_entries/22/edit' => 'timelog#edit', :issue_id => '234', :id => '22'
- should_route 'PUT /issues/234/time_entries/22' => 'timelog#update', :issue_id => '234', :id => '22'
- should_route 'DELETE /issues/234/time_entries/22' => 'timelog#destroy', :issue_id => '234', :id => '22'
end
def test_timelogs_report