You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # Redmine - project management software
  2. # Copyright (C) 2006-2017 Jean-Philippe Lang
  3. #
  4. # This program is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU General Public License
  6. # as published by the Free Software Foundation; either version 2
  7. # of the License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  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
  16. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. require File.expand_path('../../../test_helper', __FILE__)
  18. class RoutingTimelogsTest < Redmine::RoutingTest
  19. def test_timelogs_global
  20. should_route 'GET /time_entries' => 'timelog#index'
  21. should_route 'GET /time_entries.csv' => 'timelog#index', :format => 'csv'
  22. should_route 'GET /time_entries.atom' => 'timelog#index', :format => 'atom'
  23. should_route 'GET /time_entries/new' => 'timelog#new'
  24. should_route 'POST /time_entries/new' => 'timelog#new'
  25. should_route 'POST /time_entries' => 'timelog#create'
  26. should_route 'GET /time_entries/22/edit' => 'timelog#edit', :id => '22'
  27. should_route 'PATCH /time_entries/22/edit' => 'timelog#edit', :id => '22'
  28. should_route 'PATCH /time_entries/22' => 'timelog#update', :id => '22'
  29. should_route 'DELETE /time_entries/22' => 'timelog#destroy', :id => '22'
  30. end
  31. def test_timelogs_scoped_under_project
  32. should_route 'GET /projects/foo/time_entries' => 'timelog#index', :project_id => 'foo'
  33. should_route 'GET /projects/foo/time_entries.csv' => 'timelog#index', :project_id => 'foo', :format => 'csv'
  34. should_route 'GET /projects/foo/time_entries.atom' => 'timelog#index', :project_id => 'foo', :format => 'atom'
  35. should_route 'GET /projects/foo/time_entries/new' => 'timelog#new', :project_id => 'foo'
  36. should_route 'POST /projects/foo/time_entries' => 'timelog#create', :project_id => 'foo'
  37. end
  38. def test_timelogs_scoped_under_issues
  39. should_route 'GET /issues/234/time_entries/new' => 'timelog#new', :issue_id => '234'
  40. should_route 'POST /issues/234/time_entries' => 'timelog#create', :issue_id => '234'
  41. end
  42. def test_timelogs_report
  43. should_route 'GET /time_entries/report' => 'timelog#report'
  44. should_route 'GET /time_entries/report.csv' => 'timelog#report', :format => 'csv'
  45. should_route 'GET /projects/foo/time_entries/report' => 'timelog#report', :project_id => 'foo'
  46. should_route 'GET /projects/foo/time_entries/report.csv' => 'timelog#report', :project_id => 'foo', :format => 'csv'
  47. end
  48. def test_timelogs_bulk_edit
  49. should_route 'GET /time_entries/bulk_edit' => 'timelog#bulk_edit'
  50. should_route 'POST /time_entries/bulk_edit' => 'timelog#bulk_edit'
  51. should_route 'POST /time_entries/bulk_update' => 'timelog#bulk_update'
  52. should_route 'DELETE /time_entries/destroy' => 'timelog#destroy'
  53. end
  54. end