diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-14 18:18:19 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2017-03-14 18:18:19 +0000 |
commit | 8c7898bb5db0d29cd418eac3c6e27191cf3571ed (patch) | |
tree | aae5c57d61644de3c1d3786192ce7e2069c23e13 /test/functional/my_controller_test.rb | |
parent | b878a427f2928e600ca51d03fc47637fa85cf859 (diff) | |
download | redmine-8c7898bb5db0d29cd418eac3c6e27191cf3571ed.tar.gz redmine-8c7898bb5db0d29cd418eac3c6e27191cf3571ed.zip |
Let user choose columns and sort order of issue lists on "My page" (#1565).
git-svn-id: http://svn.redmine.org/redmine/trunk@16400 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/my_controller_test.rb')
-rw-r--r-- | test/functional/my_controller_test.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/functional/my_controller_test.rb b/test/functional/my_controller_test.rb index 76237dfb5..f79cca5d9 100644 --- a/test/functional/my_controller_test.rb +++ b/test/functional/my_controller_test.rb @@ -51,6 +51,47 @@ class MyControllerTest < Redmine::ControllerTest end end + def test_page_with_assigned_issues_block_and_no_custom_settings + preferences = User.find(2).pref + preferences.my_page_layout = {'top' => ['issuesassignedtome']} + preferences.my_page_settings = nil + preferences.save! + + get :page + assert_select '#block-issuesassignedtome' do + assert_select 'table.issues' do + assert_select 'th a[data-remote=true][data-method=post]', :text => 'Tracker' + end + assert_select '#issuesassignedtome-settings' do + assert_select 'select[name=?]', 'settings[issuesassignedtome][columns][]' + end + end + end + + def test_page_with_assigned_issues_block_and_custom_columns + preferences = User.find(2).pref + preferences.my_page_layout = {'top' => ['issuesassignedtome']} + preferences.my_page_settings = {'issuesassignedtome' => {:columns => ['tracker', 'subject', 'due_date']}} + preferences.save! + + get :page + assert_select '#block-issuesassignedtome' do + assert_select 'table.issues td.due_date' + end + end + + def test_page_with_assigned_issues_block_and_custom_sort + preferences = User.find(2).pref + preferences.my_page_layout = {'top' => ['issuesassignedtome']} + preferences.my_page_settings = {'issuesassignedtome' => {:sort => 'due_date'}} + preferences.save! + + get :page + assert_select '#block-issuesassignedtome' do + assert_select 'table.issues.sort-by-due-date' + end + end + def test_page_with_all_blocks blocks = Redmine::MyPage.blocks.keys preferences = User.find(2).pref |