]> source.dussan.org Git - redmine.git/commitdiff
Fixed CSV content for parent issue column (#13608).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 4 Nov 2014 20:02:27 +0000 (20:02 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 4 Nov 2014 20:02:27 +0000 (20:02 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@13555 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/queries_helper.rb
test/functional/issues_controller_test.rb

index 0206b160a214fb76ccc986817451bbb30ed42179..75867ac1226a5040559cf56ac6c99902306f996f 100644 (file)
@@ -128,6 +128,8 @@ module QueriesHelper
       when 'IssueRelation'
         other = value.other_issue(issue)
         l(value.label_for(issue)) + " ##{other.id}"
+      when 'Issue'
+        value.id
       else
         value
       end
index 8ffb9c848377f2dafa7c3510cf393931952beda6..a95588cac4ca3dbdf44e2bedf68a737ded34adcb 100644 (file)
@@ -472,6 +472,18 @@ class IssuesControllerTest < ActionController::TestCase
     end
   end
 
+  def test_index_csv_should_fill_parent_column_with_parent_id
+    Issue.delete_all
+    parent = Issue.generate!
+    child = Issue.generate!(:parent_issue_id => parent.id)
+
+    with_settings :default_language => 'en' do
+      get :index, :format => 'csv', :c => %w(parent)
+    end
+    lines = response.body.split
+    assert_include "#{child.id},#{parent.id}", lines
+  end
+
   def test_index_csv_big_5
     with_settings :default_language => "zh-TW" do
       str_utf8  = "\xe4\xb8\x80\xe6\x9c\x88".force_encoding('UTF-8')