diff options
author | Go MAEDA <maeda@farend.jp> | 2020-01-12 07:04:16 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2020-01-12 07:04:16 +0000 |
commit | 6032751ad96f3a9d16fbf2d62b9844a5e45ee82a (patch) | |
tree | f4ece0f611baf3bf93da1c87dd0e5cd39687529d /test/functional | |
parent | bd0909310afa3825de1414af51ffda54967acb49 (diff) | |
download | redmine-6032751ad96f3a9d16fbf2d62b9844a5e45ee82a.tar.gz redmine-6032751ad96f3a9d16fbf2d62b9844a5e45ee82a.zip |
Merged r19421 from trunk to 4.1-stable (#32769).
Patch by Marius BALTEANU.
git-svn-id: http://svn.redmine.org/redmine/branches/4.1-stable@19422 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/projects_controller_test.rb | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index cd3c16f96..b09af65bb 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -98,7 +98,7 @@ class ProjectsControllerTest < Redmine::ControllerTest def test_index_as_list_should_format_column_value get :index, :params => { - :c => ['name', 'status', 'short_description', 'homepage', 'parent_id', 'identifier', 'is_public', 'created_on', 'project.cf_3'], + :c => ['name', 'status', 'short_description', 'homepage', 'parent_id', 'identifier', 'is_public', 'created_on', 'cf_3'], :display_type => 'list' } assert_response :success @@ -113,7 +113,7 @@ class ProjectsControllerTest < Redmine::ControllerTest assert_select 'td.identifier', :text => 'ecookbook' assert_select 'td.is_public', :text => 'Yes' assert_select 'td.created_on', :text => format_time(project.created_on) - assert_select 'td.project_cf_3.list', :text => 'Stable' + assert_select 'td.cf_3.list', :text => 'Stable' end assert_select 'tr[id=?]', 'project-4' do assert_select 'td.parent_id a[href=?]', '/projects/ecookbook', :text => 'eCookbook' @@ -209,6 +209,29 @@ class ProjectsControllerTest < Redmine::ControllerTest end end + def test_index_sort_by_custom_field + @request.session[:user_id] = 1 + + cf = ProjectCustomField.find(3) + CustomValue.create!(:custom_field => cf, :customized => Project.find(2), :value => 'Beta') + + get( + :index, + :params => { + :display_type => 'list', + :c => ['name', 'identifier', 'cf_3'], + :set_filter => 1, + :sort => "cf_#{cf.id}:asc" + } + ) + assert_response :success + + assert_equal( + ['Beta', 'Stable'], + columns_values_in_list('cf_3').reject {|p| p.empty?} + ) + end + def test_autocomplete_js get :autocomplete, :params => { :format => 'js', |