To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / .svn / pristine / 27 / 270c9debef33419abbdab93ac142c4646e6e19cf.svn-base @ 1298:4f746d8966dd
History | View | Annotate | Download (2.33 KB)
| 1 | 1295:622f24f53b42 | Chris | # Redmine - project management software |
|---|---|---|---|
| 2 | # Copyright (C) 2006-2013 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 | |||
| 18 | require File.expand_path('../../test_helper', __FILE__)
|
||
| 19 | |||
| 20 | class ReportsControllerTest < ActionController::TestCase |
||
| 21 | fixtures :projects, :trackers, :issue_statuses, :issues, |
||
| 22 | :enumerations, :users, :issue_categories, |
||
| 23 | :projects_trackers, |
||
| 24 | :roles, |
||
| 25 | :member_roles, |
||
| 26 | :members, |
||
| 27 | :enabled_modules, |
||
| 28 | :versions |
||
| 29 | |||
| 30 | def test_get_issue_report |
||
| 31 | get :issue_report, :id => 1 |
||
| 32 | |||
| 33 | assert_response :success |
||
| 34 | assert_template 'issue_report' |
||
| 35 | |||
| 36 | [:issues_by_tracker, :issues_by_version, :issues_by_category, :issues_by_assigned_to, |
||
| 37 | :issues_by_author, :issues_by_subproject, :issues_by_priority].each do |ivar| |
||
| 38 | assert_not_nil assigns(ivar) |
||
| 39 | end |
||
| 40 | |||
| 41 | assert_equal IssuePriority.all.reverse, assigns(:priorities) |
||
| 42 | end |
||
| 43 | |||
| 44 | def test_get_issue_report_details |
||
| 45 | %w(tracker version priority category assigned_to author subproject).each do |detail| |
||
| 46 | get :issue_report_details, :id => 1, :detail => detail |
||
| 47 | |||
| 48 | assert_response :success |
||
| 49 | assert_template 'issue_report_details' |
||
| 50 | assert_not_nil assigns(:field) |
||
| 51 | assert_not_nil assigns(:rows) |
||
| 52 | assert_not_nil assigns(:data) |
||
| 53 | assert_not_nil assigns(:report_title) |
||
| 54 | end |
||
| 55 | end |
||
| 56 | |||
| 57 | def test_get_issue_report_details_by_priority |
||
| 58 | get :issue_report_details, :id => 1, :detail => 'priority' |
||
| 59 | assert_equal IssuePriority.all.reverse, assigns(:rows) |
||
| 60 | end |
||
| 61 | |||
| 62 | def test_get_issue_report_details_with_an_invalid_detail |
||
| 63 | get :issue_report_details, :id => 1, :detail => 'invalid' |
||
| 64 | |||
| 65 | assert_redirected_to '/projects/ecookbook/issues/report' |
||
| 66 | end |
||
| 67 | end |