##// END OF EJS Templates
Rails4: fix "assert_template 'calendar'" fails at CalendarsControllerTest...
Toshi MARUYAMA -
r12525:61b5a44b1ab0
parent child
Show More
@@ -1,84 +1,84
1 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2014 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 require File.expand_path('../../test_helper', __FILE__)
19 19
20 20 class CalendarsControllerTest < ActionController::TestCase
21 21 fixtures :projects,
22 22 :trackers,
23 23 :projects_trackers,
24 24 :roles,
25 25 :member_roles,
26 26 :members,
27 27 :enabled_modules
28 28
29 29 def test_show
30 30 get :show, :project_id => 1
31 31 assert_response :success
32 assert_template 'calendar'
32 assert_template :partial => '_calendar'
33 33 assert_not_nil assigns(:calendar)
34 34 end
35 35
36 36 def test_show_should_run_custom_queries
37 37 @query = IssueQuery.create!(:name => 'Calendar', :visibility => IssueQuery::VISIBILITY_PUBLIC)
38 38
39 39 get :show, :query_id => @query.id
40 40 assert_response :success
41 41 end
42 42
43 43 def test_cross_project_calendar
44 44 get :show
45 45 assert_response :success
46 assert_template 'calendar'
46 assert_template :partial => '_calendar'
47 47 assert_not_nil assigns(:calendar)
48 48 end
49 49
50 50 def test_week_number_calculation
51 51 Setting.start_of_week = 7
52 52
53 53 get :show, :month => '1', :year => '2010'
54 54 assert_response :success
55 55
56 56 assert_select 'tr' do
57 57 assert_select 'td.week-number', :text => '53'
58 58 assert_select 'td.odd', :text => '27'
59 59 assert_select 'td.even', :text => '2'
60 60 end
61 61
62 62 assert_select 'tr' do
63 63 assert_select 'td.week-number', :text => '1'
64 64 assert_select 'td.odd', :text => '3'
65 65 assert_select 'td.even', :text => '9'
66 66 end
67 67
68 68 Setting.start_of_week = 1
69 69 get :show, :month => '1', :year => '2010'
70 70 assert_response :success
71 71
72 72 assert_select 'tr' do
73 73 assert_select 'td.week-number', :text => '53'
74 74 assert_select 'td.even', :text => '28'
75 75 assert_select 'td.even', :text => '3'
76 76 end
77 77
78 78 assert_select 'tr' do
79 79 assert_select 'td.week-number', :text => '1'
80 80 assert_select 'td.even', :text => '4'
81 81 assert_select 'td.even', :text => '10'
82 82 end
83 83 end
84 84 end
General Comments 0
You need to be logged in to leave comments. Login now