diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-16 21:28:03 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-16 21:28:03 +0000 |
commit | 043c2c92da7d922f43f77ad9d88b738781846df5 (patch) | |
tree | f7c81fc3838cd4abc6c21002aa63f380b9a09293 | |
parent | ecda1c7a4f30354db74e73eade71550074f67356 (diff) | |
download | redmine-043c2c92da7d922f43f77ad9d88b738781846df5.tar.gz redmine-043c2c92da7d922f43f77ad9d88b738781846df5.zip |
Removed deep nested time entries routes.
git-svn-id: http://svn.redmine.org/redmine/trunk@13609 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/views/timelog/edit.html.erb | 2 | ||||
-rw-r--r-- | config/routes.rb | 4 | ||||
-rw-r--r-- | test/functional/timelog_controller_test.rb | 3 | ||||
-rw-r--r-- | test/integration/routing/timelog_test.rb | 10 |
4 files changed, 4 insertions, 15 deletions
diff --git a/app/views/timelog/edit.html.erb b/app/views/timelog/edit.html.erb index db2e73cd5..de0ea5993 100644 --- a/app/views/timelog/edit.html.erb +++ b/app/views/timelog/edit.html.erb @@ -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 %> diff --git a/config/routes.rb b/config/routes.rb index 5fe1cf713..1b57a6ecb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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 diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb index a0ef98a64..d07f7a946 100644 --- a/test/functional/timelog_controller_test.rb +++ b/test/functional/timelog_controller_test.rb @@ -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 diff --git a/test/integration/routing/timelog_test.rb b/test/integration/routing/timelog_test.rb index fc5c89644..bec2eb271 100644 --- a/test/integration/routing/timelog_test.rb +++ b/test/integration/routing/timelog_test.rb @@ -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 |