From 66540afc08209939dd4b9a6d9969b99a6ffecfc9 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 28 Nov 2009 11:34:12 +0000 Subject: Adds dynamic columns selection on the issue list (#4272). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3105 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/issues_controller_test.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb index 3ece848b7..9555db4ea 100644 --- a/test/functional/issues_controller_test.rb +++ b/test/functional/issues_controller_test.rb @@ -255,6 +255,22 @@ class IssuesControllerTest < ActionController::TestCase assert !issues.empty? assert_equal issues.sort {|a,b| a.tracker == b.tracker ? b.id <=> a.id : a.tracker <=> b.tracker }.collect(&:id), issues.collect(&:id) end + + def test_index_with_columns + columns = ['tracker', 'subject', 'assigned_to'] + get :index, :set_filter => 1, :query => { 'column_names' => columns} + assert_response :success + + # query should use specified columns + query = assigns(:query) + assert_kind_of Query, query + assert_equal columns, query.column_names.map(&:to_s) + + # columns should be stored in session + assert_kind_of Hash, session[:query] + assert_kind_of Array, session[:query][:column_names] + assert_equal columns, session[:query][:column_names].map(&:to_s) + end def test_gantt get :gantt, :project_id => 1 -- cgit v1.2.3