From 501111708657d54eccefaa6d82b465d471b65ef9 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 2 Nov 2019 07:22:45 +0000 Subject: Fix CSV export of projects (#29482). Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@18888 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/helpers/projects_queries_helper_test.rb | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/helpers/projects_queries_helper_test.rb (limited to 'test/helpers') diff --git a/test/helpers/projects_queries_helper_test.rb b/test/helpers/projects_queries_helper_test.rb new file mode 100644 index 000000000..e70471fe2 --- /dev/null +++ b/test/helpers/projects_queries_helper_test.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +# Redmine - project management software +# Copyright (C) 2006-2019 Jean-Philippe Lang +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +require File.expand_path('../../test_helper', __FILE__) + +class ProjectsQueriesHelperTest < Redmine::HelperTest + include ProjectsQueriesHelper + + fixtures :projects, :enabled_modules, + :custom_fields, :custom_values + + def test_csv_value + c_status = QueryColumn.new(:status) + c_parent_id = QueryColumn.new(:parent_id) + + assert_equal "active", csv_value(c_status, Project.find(1), 1) + assert_equal "eCookbook", csv_value(c_parent_id, Project.find(4), 1) + end +end -- cgit v1.2.3