Mercurial > hg > soundsoftware-site
comparison test/functional/time_entry_reports_controller_test.rb @ 441:cbce1fd3b1b7 redmine-1.2
Update to Redmine 1.2-stable branch (Redmine SVN rev 6000)
author | Chris Cannam |
---|---|
date | Mon, 06 Jun 2011 14:24:13 +0100 |
parents | 8661b858af72 |
children | cbb26bc654de |
comparison
equal
deleted
inserted
replaced
245:051f544170fe | 441:cbce1fd3b1b7 |
---|---|
2 require File.expand_path('../../test_helper', __FILE__) | 2 require File.expand_path('../../test_helper', __FILE__) |
3 | 3 |
4 class TimeEntryReportsControllerTest < ActionController::TestCase | 4 class TimeEntryReportsControllerTest < ActionController::TestCase |
5 fixtures :projects, :enabled_modules, :roles, :members, :member_roles, :issues, :time_entries, :users, :trackers, :enumerations, :issue_statuses, :custom_fields, :custom_values | 5 fixtures :projects, :enabled_modules, :roles, :members, :member_roles, :issues, :time_entries, :users, :trackers, :enumerations, :issue_statuses, :custom_fields, :custom_values |
6 | 6 |
7 def test_report_no_criteria | 7 def test_report_at_project_level |
8 get :report, :project_id => 1 | 8 get :report, :project_id => 'ecookbook' |
9 assert_response :success | 9 assert_response :success |
10 assert_template 'report' | 10 assert_template 'report' |
11 assert_tag :form, | |
12 :attributes => {:action => "/projects/ecookbook/time_entries/report", :id => 'query_form'} | |
11 end | 13 end |
12 | 14 |
13 def test_report_all_projects | 15 def test_report_all_projects |
14 get :report | 16 get :report |
15 assert_response :success | 17 assert_response :success |
16 assert_template 'report' | 18 assert_template 'report' |
19 assert_tag :form, | |
20 :attributes => {:action => "/time_entries/report", :id => 'query_form'} | |
17 end | 21 end |
18 | 22 |
19 def test_report_all_projects_denied | 23 def test_report_all_projects_denied |
20 r = Role.anonymous | 24 r = Role.anonymous |
21 r.permissions.delete(:view_time_entries) | 25 r.permissions.delete(:view_time_entries) |
78 get :report, :project_id => 1, :issue_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"] | 82 get :report, :project_id => 1, :issue_id => 1, :columns => 'month', :from => "2007-01-01", :to => "2007-12-31", :criterias => ["member", "activity"] |
79 assert_response :success | 83 assert_response :success |
80 assert_template 'report' | 84 assert_template 'report' |
81 assert_not_nil assigns(:total_hours) | 85 assert_not_nil assigns(:total_hours) |
82 assert_equal "154.25", "%.2f" % assigns(:total_hours) | 86 assert_equal "154.25", "%.2f" % assigns(:total_hours) |
87 assert_tag :form, | |
88 :attributes => {:action => "/projects/ecookbook/issues/1/time_entries/report", :id => 'query_form'} | |
83 end | 89 end |
84 | 90 |
85 def test_report_custom_field_criteria | 91 def test_report_custom_field_criteria |
86 get :report, :project_id => 1, :criterias => ['project', 'cf_1', 'cf_7'] | 92 get :report, :project_id => 1, :criterias => ['project', 'cf_1', 'cf_7'] |
87 assert_response :success | 93 assert_response :success |