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 / d9 / d98580268108411b4971461a40dedaf1dca1cebb.svn-base @ 1297:0a574315af3e
History | View | Annotate | Download (2.37 KB)
| 1 | 1296:038ba2d95de8 | Chris | # 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 | |||
| 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 | :workflows, |
||
| 29 | :versions |
||
| 30 | |||
| 31 | def setup |
||
| 32 | end |
||
| 33 | |||
| 34 | def test_get_issue_report |
||
| 35 | get :issue_report, :id => 1 |
||
| 36 | |||
| 37 | assert_response :success |
||
| 38 | assert_template 'issue_report' |
||
| 39 | |||
| 40 | [:issues_by_tracker, :issues_by_version, :issues_by_category, :issues_by_assigned_to, |
||
| 41 | :issues_by_author, :issues_by_subproject, :issues_by_priority].each do |ivar| |
||
| 42 | assert_not_nil assigns(ivar) |
||
| 43 | end |
||
| 44 | |||
| 45 | assert_equal IssuePriority.all.reverse, assigns(:priorities) |
||
| 46 | end |
||
| 47 | |||
| 48 | def test_get_issue_report_details |
||
| 49 | %w(tracker version priority category assigned_to author subproject).each do |detail| |
||
| 50 | get :issue_report_details, :id => 1, :detail => detail |
||
| 51 | |||
| 52 | assert_response :success |
||
| 53 | assert_template 'issue_report_details' |
||
| 54 | assert_not_nil assigns(:field) |
||
| 55 | assert_not_nil assigns(:rows) |
||
| 56 | assert_not_nil assigns(:data) |
||
| 57 | assert_not_nil assigns(:report_title) |
||
| 58 | end |
||
| 59 | end |
||
| 60 | |||
| 61 | def test_get_issue_report_details_by_priority |
||
| 62 | get :issue_report_details, :id => 1, :detail => 'priority' |
||
| 63 | assert_equal IssuePriority.all.reverse, assigns(:rows) |
||
| 64 | end |
||
| 65 | |||
| 66 | def test_get_issue_report_details_with_an_invalid_detail |
||
| 67 | get :issue_report_details, :id => 1, :detail => 'invalid' |
||
| 68 | |||
| 69 | assert_redirected_to '/projects/ecookbook/issues/report' |
||
| 70 | end |
||
| 71 | end |