summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-13 19:17:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2017-03-13 19:17:59 +0000
commit71d88e55352a51b20dd5e2a4a44aa695834a36b9 (patch)
tree8d5708333c51b7da7319a5c182350758b00dc535 /test/functional
parentb91489ce6bb0943cff50946af6e64be65d3ccd80 (diff)
downloadredmine-71d88e55352a51b20dd5e2a4a44aa695834a36b9.tar.gz
redmine-71d88e55352a51b20dd5e2a4a44aa695834a36b9.zip
Get rid of sort_helper when using queries.
git-svn-id: http://svn.redmine.org/redmine/trunk@16390 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/issues_controller_test.rb18
-rw-r--r--test/functional/issues_custom_fields_visibility_test.rb2
2 files changed, 6 insertions, 14 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index 24ec49a70..914d7c386 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -682,10 +682,6 @@ class IssuesControllerTest < Redmine::ControllerTest
get :index, :sort => 'tracker,id:desc'
assert_response :success
- sort_params = @request.session['issues_index_sort']
- assert sort_params.is_a?(String)
- assert_equal 'tracker,id:desc', sort_params
-
assert_equal issues_in_list.sort_by {|issue| [issue.tracker.position, -issue.id]}, issues_in_list
assert_select 'table.issues.sort-by-tracker.sort-asc'
end
@@ -1402,8 +1398,7 @@ class IssuesControllerTest < Redmine::ControllerTest
end
def test_show_should_display_prev_next_links_with_query_in_session
- @request.session[:issue_query] = {:filters => {'status_id' => {:values => [''], :operator => 'o'}}, :project_id => nil}
- @request.session['issues_index_sort'] = 'id'
+ @request.session[:issue_query] = {:filters => {'status_id' => {:values => [''], :operator => 'o'}}, :project_id => nil, :sort => [['id', 'asc']]}
with_settings :display_subprojects_issues => '0' do
get :show, :id => 3
@@ -1440,7 +1435,7 @@ class IssuesControllerTest < Redmine::ControllerTest
@request.session[:issue_query] = {:filters => {'status_id' => {:values => [''], :operator => 'o'}}, :project_id => nil}
%w(project tracker status priority author assigned_to category fixed_version).each do |assoc_sort|
- @request.session['issues_index_sort'] = assoc_sort
+ @request.session[:issue_query][:sort] = [[assoc_sort, 'asc']]
get :show, :id => 3
assert_response :success, "Wrong response status for #{assoc_sort} sort"
@@ -1452,8 +1447,7 @@ class IssuesControllerTest < Redmine::ControllerTest
end
def test_show_should_display_prev_next_links_with_project_query_in_session
- @request.session[:issue_query] = {:filters => {'status_id' => {:values => [''], :operator => 'o'}}, :project_id => 1}
- @request.session['issues_index_sort'] = 'id'
+ @request.session[:issue_query] = {:filters => {'status_id' => {:values => [''], :operator => 'o'}}, :project_id => 1, :sort => [['id','asc']]}
with_settings :display_subprojects_issues => '0' do
get :show, :id => 3
@@ -1468,8 +1462,7 @@ class IssuesControllerTest < Redmine::ControllerTest
end
def test_show_should_not_display_prev_link_for_first_issue
- @request.session[:issue_query] = {:filters => {'status_id' => {:values => [''], :operator => 'o'}}, :project_id => 1}
- @request.session['issues_index_sort'] = 'id'
+ @request.session[:issue_query] = {:filters => {'status_id' => {:values => [''], :operator => 'o'}}, :project_id => 1, :sort => [['id', 'asc']]}
with_settings :display_subprojects_issues => '0' do
get :show, :id => 1
@@ -1483,8 +1476,7 @@ class IssuesControllerTest < Redmine::ControllerTest
end
def test_show_should_not_display_prev_next_links_for_issue_not_in_query_results
- @request.session[:issue_query] = {:filters => {'status_id' => {:values => [''], :operator => 'c'}}, :project_id => 1}
- @request.session['issues_index_sort'] = 'id'
+ @request.session[:issue_query] = {:filters => {'status_id' => {:values => [''], :operator => 'c'}}, :project_id => 1, :sort => [['id', 'asc']]}
get :show, :id => 1
assert_response :success
diff --git a/test/functional/issues_custom_fields_visibility_test.rb b/test/functional/issues_custom_fields_visibility_test.rb
index 6ebe0c48f..cd395d88c 100644
--- a/test/functional/issues_custom_fields_visibility_test.rb
+++ b/test/functional/issues_custom_fields_visibility_test.rb
@@ -215,7 +215,7 @@ class IssuesCustomFieldsVisibilityTest < Redmine::ControllerTest
# ValueB is not visible to user and ignored while sorting
assert_equal %w(ValueB ValueA ValueC), issues_in_list.map{|i| i.custom_field_value(@field2)}
- get :index, :set_filter => '1', "cf_#{@field2.id}" => '*'
+ get :index, :set_filter => '1', "cf_#{@field2.id}" => '*', :sort => "cf_#{@field2.id}"
assert_equal %w(ValueA ValueC), issues_in_list.map{|i| i.custom_field_value(@field2)}
CustomField.update_all(:field_format => 'list')