Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix download ics in action

Oliver Günther10ff274b1851
diff --git a/modules/meeting/app/components/recurring_meetings/row_component.rb b/modules/meeting/app/components/recurring_meetings/row_component.rb
index a489cc2a5d7..5db63e2e442 100644
--- a/modules/meeting/app/components/recurring_meetings/row_component.rb
+++ b/modules/meeting/app/components/recurring_meetings/row_component.rb
@@ -156,7 +156,7 @@ module RecurringMeetings
menu.with_item(label: I18n.t(:label_icalendar_download),
href: download_ics_project_recurring_meeting_path(project,
model.recurring_meeting,
- occurrence_id: model.id),
+ occurrence_id: meeting.id),
content_arguments: {
data: { turbo: false }
}) do |item|
diff --git a/modules/meeting/spec/components/recurring_meetings/row_component_spec.rb b/modules/meeting/spec/components/recurring_meetings/row_component_spec.rb
index 2cb8825e99b..8df9b808249 100644
--- a/modules/meeting/spec/components/recurring_meetings/row_component_spec.rb
+++ b/modules/meeting/spec/components/recurring_meetings/row_component_spec.rb
@@ -51,7 +51,21 @@ RSpec.describe RecurringMeetings::RowComponent, type: :component do
login_as(user)
end
- describe "actions" do
+ describe "download ics file" do
+ let(:meeting) { build_stubbed(:meeting, id: 1234, project:, recurring_meeting:) }
+ let(:scheduled_meeting) { build_stubbed(:scheduled_meeting, id: 999, meeting:, recurring_meeting:) }
+
+ it "links to the correct meeting (Regression #61462)" do
+ expect(subject).to have_link "Download iCalendar event",
+ href: download_ics_project_recurring_meeting_path(
+ project,
+ recurring_meeting,
+ occurrence_id: meeting.id
+ )
+ end
+ end
+
+ describe "cancel occurrence" do
context "with project delete meetings permissions" do
before do
mock_permissions_for(user) do |mock|