comparison test/functional/calendars_controller_test.rb @ 909:cbb26bc654de redmine-1.3

Update to Redmine 1.3-stable branch (Redmine SVN rev 8964)
author Chris Cannam
date Fri, 24 Feb 2012 19:09:32 +0000
parents 0c939c159af4
children 433d4f72a19b
comparison
equal deleted inserted replaced
908:c6c2cbd0afee 909:cbb26bc654de
1 require File.expand_path('../../test_helper', __FILE__) 1 require File.expand_path('../../test_helper', __FILE__)
2 2
3 class CalendarsControllerTest < ActionController::TestCase 3 class CalendarsControllerTest < ActionController::TestCase
4 fixtures :all 4 fixtures :projects,
5 :trackers,
6 :projects_trackers,
7 :roles,
8 :member_roles,
9 :members,
10 :auth_sources,
11 :enabled_modules
5 12
6 def test_calendar 13 def test_calendar
7 get :show, :project_id => 1 14 get :show, :project_id => 1
8 assert_response :success 15 assert_response :success
9 assert_template 'calendar' 16 assert_template 'calendar'
10 assert_not_nil assigns(:calendar) 17 assert_not_nil assigns(:calendar)
11 end 18 end
12 19
13 def test_cross_project_calendar 20 def test_cross_project_calendar
14 get :show 21 get :show
15 assert_response :success 22 assert_response :success
16 assert_template 'calendar' 23 assert_template 'calendar'
17 assert_not_nil assigns(:calendar) 24 assert_not_nil assigns(:calendar)
18 end 25 end
19 26
20 context "GET :show" do 27 context "GET :show" do
21 should "run custom queries" do 28 should "run custom queries" do
22 @query = Query.generate_default!(:is_public => true) 29 @query = Query.generate_default!(:is_public => true)
23 30
24 get :show, :query_id => @query.id 31 get :show, :query_id => @query.id
25 assert_response :success 32 assert_response :success
26 end 33 end
27 34
28 end 35 end
29 36
30 def test_week_number_calculation 37 def test_week_number_calculation
31 Setting.start_of_week = 7 38 Setting.start_of_week = 7
32 39
33 get :show, :month => '1', :year => '2010' 40 get :show, :month => '1', :year => '2010'
34 assert_response :success 41 assert_response :success
35 42
36 assert_tag :tag => 'tr', 43 assert_tag :tag => 'tr',
37 :descendant => {:tag => 'td', 44 :descendant => {:tag => 'td',
38 :attributes => {:class => 'week-number'}, :content => '53'}, 45 :attributes => {:class => 'week-number'}, :content => '53'},
39 :descendant => {:tag => 'td', 46 :descendant => {:tag => 'td',
40 :attributes => {:class => 'odd'}, :content => '27'}, 47 :attributes => {:class => 'odd'}, :content => '27'},