Defect #44731 ยป 44731-history-default-tab-nil.patch
| app/helpers/issues_helper.rb | ||
|---|---|---|
|
case user_default_tab
|
||
|
when 'last_tab_visited'
|
||
|
cookies['history_last_tab'].presence || 'notes'
|
||
|
when ''
|
||
|
when '', nil
|
||
|
'notes'
|
||
|
else
|
||
|
user_default_tab
|
||
| test/functional/issues_controller_test.rb | ||
|---|---|---|
|
end
|
||
|
end
|
||
|
def test_show_should_select_notes_tab_when_history_default_tab_preference_is_not_set
|
||
|
assert_nil User.find(1).pref.history_default_tab
|
||
|
@request.session[:user_id] = 1
|
||
|
get :show, :params => {:id => 1}
|
||
|
assert_response :success
|
||
|
assert_select '#history div.tabs a.selected', 1
|
||
|
assert_select '#history div.tabs a.selected[id=?]', 'tab-notes'
|
||
|
end
|
||
|
def test_show_should_select_notes_tab_for_anonymous
|
||
|
get :show, :params => {:id => 1}
|
||
|
assert_response :success
|
||
|
assert_select '#history div.tabs a.selected[id=?]', 'tab-notes'
|
||
|
end
|
||
|
def test_show_display_changesets_tab_for_issue_with_changesets
|
||
|
project = Project.find(2)
|
||
|
issue = Issue.find(9)
|
||