Revision 13318
Added by Jean-Philippe Lang about 11 years ago
sandbox/rails-4.1/test/functional/calendars_controller_test.rb | ||
---|---|---|
48 | 48 |
end |
49 | 49 | |
50 | 50 |
def test_week_number_calculation |
51 |
Setting.start_of_week = 7 |
|
51 |
with_settings :start_of_week => 7 do |
|
52 |
get :show, :month => '1', :year => '2010' |
|
53 |
assert_response :success |
|
54 |
end |
|
52 | 55 | |
53 |
get :show, :month => '1', :year => '2010' |
|
54 |
assert_response :success |
|
55 | ||
56 | 56 |
assert_select 'tr' do |
57 | 57 |
assert_select 'td.week-number', :text => '53' |
58 | 58 |
assert_select 'td.odd', :text => '27' |
... | ... | |
65 | 65 |
assert_select 'td.even', :text => '9' |
66 | 66 |
end |
67 | 67 | |
68 |
Setting.start_of_week = 1 |
|
69 |
get :show, :month => '1', :year => '2010' |
|
70 |
assert_response :success |
|
68 |
with_settings :start_of_week => 1 do |
|
69 |
get :show, :month => '1', :year => '2010' |
|
70 |
assert_response :success |
|
71 |
end |
|
71 | 72 | |
72 | 73 |
assert_select 'tr' do |
73 | 74 |
assert_select 'td.week-number', :text => '53' |
Also available in: Unified diff
Don't change start_of_week setting for the other tests.