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.

issue_relations_test.rb 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Redmine - project management software
  2. # Copyright (C) 2006-2014 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 RoutingIssueRelationsTest < ActionController::IntegrationTest
  19. def test_issue_relations
  20. assert_routing(
  21. { :method => 'get', :path => "/issues/1/relations" },
  22. { :controller => 'issue_relations', :action => 'index',
  23. :issue_id => '1' }
  24. )
  25. assert_routing(
  26. { :method => 'get', :path => "/issues/1/relations.xml" },
  27. { :controller => 'issue_relations', :action => 'index',
  28. :issue_id => '1', :format => 'xml' }
  29. )
  30. assert_routing(
  31. { :method => 'get', :path => "/issues/1/relations.json" },
  32. { :controller => 'issue_relations', :action => 'index',
  33. :issue_id => '1', :format => 'json' }
  34. )
  35. assert_routing(
  36. { :method => 'post', :path => "/issues/1/relations" },
  37. { :controller => 'issue_relations', :action => 'create',
  38. :issue_id => '1' }
  39. )
  40. assert_routing(
  41. { :method => 'post', :path => "/issues/1/relations.xml" },
  42. { :controller => 'issue_relations', :action => 'create',
  43. :issue_id => '1', :format => 'xml' }
  44. )
  45. assert_routing(
  46. { :method => 'post', :path => "/issues/1/relations.json" },
  47. { :controller => 'issue_relations', :action => 'create',
  48. :issue_id => '1', :format => 'json' }
  49. )
  50. assert_routing(
  51. { :method => 'get', :path => "/relations/23" },
  52. { :controller => 'issue_relations', :action => 'show', :id => '23' }
  53. )
  54. assert_routing(
  55. { :method => 'get', :path => "/relations/23.xml" },
  56. { :controller => 'issue_relations', :action => 'show', :id => '23',
  57. :format => 'xml' }
  58. )
  59. assert_routing(
  60. { :method => 'get', :path => "/relations/23.json" },
  61. { :controller => 'issue_relations', :action => 'show', :id => '23',
  62. :format => 'json' }
  63. )
  64. assert_routing(
  65. { :method => 'delete', :path => "/relations/23" },
  66. { :controller => 'issue_relations', :action => 'destroy', :id => '23' }
  67. )
  68. assert_routing(
  69. { :method => 'delete', :path => "/relations/23.xml" },
  70. { :controller => 'issue_relations', :action => 'destroy', :id => '23',
  71. :format => 'xml' }
  72. )
  73. assert_routing(
  74. { :method => 'delete', :path => "/relations/23.json" },
  75. { :controller => 'issue_relations', :action => 'destroy', :id => '23',
  76. :format => 'json' }
  77. )
  78. end
  79. end