Commit ffef28cc authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch '54146-fix-calendar-query' into 'master'

Fix calendar feed when sorted by priority

Closes #54146

See merge request gitlab-org/gitlab-ce!23870
parents 1f7c072e 685c0f23
...@@ -3,7 +3,7 @@ cal.prodid = '-//GitLab//NONSGML GitLab//EN' ...@@ -3,7 +3,7 @@ cal.prodid = '-//GitLab//NONSGML GitLab//EN'
cal.x_wr_calname = 'GitLab Issues' cal.x_wr_calname = 'GitLab Issues'
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
@issues.includes(project: :namespace).each do |issue| @issues.preload(project: :namespace).each do |issue|
cal.event do |event| cal.event do |event|
event.dtstart = Icalendar::Values::Date.new(issue.due_date) event.dtstart = Icalendar::Values::Date.new(issue.due_date)
event.summary = "#{issue.title} (in #{issue.project.full_path})" 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 ...@@ -72,5 +72,14 @@ describe 'Project Issues Calendar Feed' do
expect(body).to have_text('TRANSP:TRANSPARENT') expect(body).to have_text('TRANSP:TRANSPARENT')
end end
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
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