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 | |
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')
-rw-r--r-- | test/functional/issues_controller_test.rb | 2 | ||||
-rw-r--r-- | test/functional/my_controller_test.rb | 41 | ||||
-rw-r--r-- | test/functional/settings_controller_test.rb | 4 |
3 files changed, 44 insertions, 3 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 914d7c386..10ed24c1c 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -797,7 +797,7 @@ class IssuesControllerTest < Redmine::ControllerTest assert_equal columns, session[:issue_query][:column_names].map(&:to_s) # ensure only these columns are kept in the selected columns list - assert_select 'select#selected_columns option' do + assert_select 'select[name=?] option', 'c[]' do assert_select 'option', 3 assert_select 'option[value=tracker]' assert_select 'option[value=project]', 0 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 diff --git a/test/functional/settings_controller_test.rb b/test/functional/settings_controller_test.rb index d7dacc0ee..098c4b55b 100644 --- a/test/functional/settings_controller_test.rb +++ b/test/functional/settings_controller_test.rb @@ -51,7 +51,7 @@ class SettingsControllerTest < Redmine::ControllerTest assert_response :success end - assert_select 'select[id=selected_columns][name=?]', 'settings[issue_list_default_columns][]' do + assert_select 'select[name=?]', 'settings[issue_list_default_columns][]' do assert_select 'option', 4 assert_select 'option[value=tracker]', :text => 'Tracker' assert_select 'option[value=subject]', :text => 'Subject' @@ -59,7 +59,7 @@ class SettingsControllerTest < Redmine::ControllerTest assert_select 'option[value=updated_on]', :text => 'Updated' end - assert_select 'select[id=available_columns]' do + assert_select 'select[name=?]', 'available_columns[]' do assert_select 'option[value=tracker]', 0 assert_select 'option[value=priority]', :text => 'Priority' end |