summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-29 22:01:40 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-01-29 22:01:40 +0000
commit79b12c73d9acd43f53918d23a9f3d94a516632b5 (patch)
treefd96e989ce48fdf294b9655be2acfdf62b704bd8 /test/functional
parent0cd62a3c7776a311b0776899bf4734cd7f4e583a (diff)
downloadredmine-79b12c73d9acd43f53918d23a9f3d94a516632b5.tar.gz
redmine-79b12c73d9acd43f53918d23a9f3d94a516632b5.zip
Display of multi custom fields.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8726 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/issues_controller_test.rb14
-rw-r--r--test/functional/timelog_controller_test.rb12
2 files changed, 25 insertions, 1 deletions
diff --git a/test/functional/issues_controller_test.rb b/test/functional/issues_controller_test.rb
index aa96156b0..a41340ae6 100644
--- a/test/functional/issues_controller_test.rb
+++ b/test/functional/issues_controller_test.rb
@@ -337,6 +337,18 @@ class IssuesControllerTest < ActionController::TestCase
assert_equal assigns(:query).available_columns.size + 1, lines[0].split(',').size
end
+ def test_index_csv_with_multi_column_field
+ CustomField.find(1).update_attribute :multiple, true
+ issue = Issue.find(1)
+ issue.custom_field_values = {1 => ['MySQL', 'Oracle']}
+ issue.save!
+
+ get :index, :format => 'csv', :columns => 'all'
+ assert_response :success
+ lines = @response.body.chomp.split("\n")
+ assert lines.detect {|line| line.include?('"MySQL, Oracle"')}
+ end
+
def test_index_csv_big_5
with_settings :default_language => "zh-TW" do
str_utf8 = "\xe4\xb8\x80\xe6\x9c\x88"
@@ -1086,7 +1098,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_response :success
# TODO: should display links
- assert_tag :td, :content => 'John Smith, Dave Lopper'
+ assert_tag :td, :content => 'Dave Lopper, John Smith'
end
def test_show_atom
diff --git a/test/functional/timelog_controller_test.rb b/test/functional/timelog_controller_test.rb
index b5af1b5b8..d23426c52 100644
--- a/test/functional/timelog_controller_test.rb
+++ b/test/functional/timelog_controller_test.rb
@@ -563,6 +563,18 @@ class TimelogControllerTest < ActionController::TestCase
assert @response.body.include?("\n04/21/2007,redMine Admin,Design,eCookbook,3,Bug,Error 281 when updating a recipe,1.0,\"\",\"\"\n")
end
+ def test_index_csv_export_with_multi_custom_field
+ field = TimeEntryCustomField.create!(:name => 'Test', :field_format => 'list',
+ :multiple => true, :possible_values => ['value1', 'value2'])
+ entry = TimeEntry.find(1)
+ entry.custom_field_values = {field.id => ['value1', 'value2']}
+ entry.save!
+
+ get :index, :project_id => 1, :format => 'csv'
+ assert_response :success
+ assert_include '"value1, value2"', @response.body
+ end
+
def test_csv_big_5
user = User.find_by_id(3)
user.language = "zh-TW"