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.

reports_controller_test.rb 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Redmine - project management software
  2. # Copyright (C) 2006-2012 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 ReportsControllerTest < ActionController::TestCase
  19. fixtures :projects, :trackers, :issue_statuses, :issues,
  20. :enumerations, :users, :issue_categories,
  21. :projects_trackers,
  22. :roles,
  23. :member_roles,
  24. :members,
  25. :enabled_modules,
  26. :workflows,
  27. :versions
  28. def setup
  29. end
  30. def test_get_issue_report
  31. get :issue_report, :id => 1
  32. assert_response :success
  33. assert_template 'issue_report'
  34. [:issues_by_tracker, :issues_by_version, :issues_by_category, :issues_by_assigned_to,
  35. :issues_by_author, :issues_by_subproject].each do |ivar|
  36. assert_not_nil assigns(ivar)
  37. end
  38. end
  39. def test_get_issue_report_details
  40. %w(tracker version priority category assigned_to author subproject).each do |detail|
  41. get :issue_report_details, :id => 1, :detail => detail
  42. assert_response :success
  43. assert_template 'issue_report_details'
  44. assert_not_nil assigns(:field)
  45. assert_not_nil assigns(:rows)
  46. assert_not_nil assigns(:data)
  47. assert_not_nil assigns(:report_title)
  48. end
  49. end
  50. def test_get_issue_report_details_with_an_invalid_detail
  51. get :issue_report_details, :id => 1, :detail => 'invalid'
  52. assert_redirected_to '/projects/ecookbook/issues/report'
  53. end
  54. end