mirror of
https://github.com/redmine/redmine.git
synced 2025-11-15 09:46:02 +01:00
Time entries csv export should check issue visibility (#33075).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@19646 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -273,7 +273,7 @@ module QueriesHelper
|
||||
value.to_s(object)
|
||||
when 'Issue'
|
||||
if object.is_a?(TimeEntry)
|
||||
"#{value.tracker} ##{value.id}: #{value.subject}"
|
||||
value.visible? ? "#{value.tracker} ##{value.id}: #{value.subject}" : "##{value.id}"
|
||||
else
|
||||
value.id
|
||||
end
|
||||
|
||||
@@ -1418,6 +1418,19 @@ class TimelogControllerTest < Redmine::ControllerTest
|
||||
assert_include "#{issue.tracker} #1: #{issue.subject}", line
|
||||
end
|
||||
|
||||
def test_index_csv_should_fill_issue_column_with_issue_id_if_issue_that_is_not_visible
|
||||
@request.session[:user_id] = 3
|
||||
issue = Issue.generate!(:author_id => 1, :is_private => true)
|
||||
entry = TimeEntry.generate!(:issue => issue, :comments => "Issue column content test")
|
||||
|
||||
get :index, :params => {:format => 'csv'}
|
||||
assert_not issue.visible?
|
||||
line = response.body.split("\n").detect {|l| l.include?(entry.comments)}
|
||||
assert_not_nil line
|
||||
assert_not_include "#{issue.tracker} ##{issue.id}: #{issue.subject}", line
|
||||
assert_include "##{issue.id}", line
|
||||
end
|
||||
|
||||
def test_index_grouped_by_created_on
|
||||
skip unless TimeEntryQuery.new.groupable_columns.detect {|c| c.name == :created_on}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user