Commit 685c0f23 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Fix calendar feed when sorted by priority

parent 8b460204
......@@ -3,7 +3,7 @@ cal.prodid = '-//GitLab//NONSGML GitLab//EN'
cal.x_wr_calname = 'GitLab Issues'
# rubocop: disable CodeReuse/ActiveRecord
@issues.includes(project: :namespace).each do |issue|
@issues.preload(project: :namespace).each do |issue|
cal.event do |event|
event.dtstart = Icalendar::Values::Date.new(issue.due_date)
event.summary = "#{issue.title} (in #{issue.project.full_path})"
......
---
title: Fix project calendar feed when sorted by priority
merge_request: 23870
author:
type: fixed
......@@ -72,5 +72,14 @@ describe 'Project Issues Calendar Feed' do
expect(body).to have_text('TRANSP:TRANSPARENT')
end
end
context 'sorted by priority' do
it 'renders calendar feed' do
visit project_issues_path(project, :ics, sort: 'priority', feed_token: user.feed_token)
expect(response_headers['Content-Type']).to have_content('text/calendar')
expect(body).to have_text('BEGIN:VCALENDAR')
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment