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.

messages_test.rb 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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 RoutingMessagesTest < ActionController::IntegrationTest
  19. def test_messages
  20. assert_routing(
  21. { :method => 'get', :path => "/boards/22/topics/2" },
  22. { :controller => 'messages', :action => 'show', :id => '2',
  23. :board_id => '22' }
  24. )
  25. assert_routing(
  26. { :method => 'get', :path => "/boards/lala/topics/new" },
  27. { :controller => 'messages', :action => 'new', :board_id => 'lala' }
  28. )
  29. assert_routing(
  30. { :method => 'get', :path => "/boards/lala/topics/22/edit" },
  31. { :controller => 'messages', :action => 'edit', :id => '22',
  32. :board_id => 'lala' }
  33. )
  34. assert_routing(
  35. { :method => 'post', :path => "/boards/lala/topics/quote/22" },
  36. { :controller => 'messages', :action => 'quote', :id => '22',
  37. :board_id => 'lala' }
  38. )
  39. assert_routing(
  40. { :method => 'post', :path => "/boards/lala/topics/new" },
  41. { :controller => 'messages', :action => 'new', :board_id => 'lala' }
  42. )
  43. assert_routing(
  44. { :method => 'post', :path => "/boards/lala/topics/preview" },
  45. { :controller => 'messages', :action => 'preview',
  46. :board_id => 'lala' }
  47. )
  48. assert_routing(
  49. { :method => 'post', :path => "/boards/lala/topics/22/edit" },
  50. { :controller => 'messages', :action => 'edit', :id => '22',
  51. :board_id => 'lala' }
  52. )
  53. assert_routing(
  54. { :method => 'post', :path => "/boards/22/topics/555/replies" },
  55. { :controller => 'messages', :action => 'reply', :id => '555',
  56. :board_id => '22' }
  57. )
  58. assert_routing(
  59. { :method => 'post', :path => "/boards/22/topics/555/destroy" },
  60. { :controller => 'messages', :action => 'destroy', :id => '555',
  61. :board_id => '22' }
  62. )
  63. end
  64. end