Removed deep nested time entries routes.

git-svn-id: http://svn.redmine.org/redmine/trunk@13609 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2014-11-16 21:28:03 +00:00
parent ecda1c7a4f
commit 043c2c92da
4 changed files with 4 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
<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 %>

View File

@@ -126,7 +126,7 @@ Rails.application.routes.draw do
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]
@@ -171,7 +171,7 @@ Rails.application.routes.draw do
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

View File

@@ -100,8 +100,7 @@ class TimelogControllerTest < ActionController::TestCase
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

View File

@@ -36,11 +36,6 @@ class RoutingTimelogsTest < Redmine::RoutingTest
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
@@ -49,11 +44,6 @@ class RoutingTimelogsTest < Redmine::RoutingTest
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