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

Add a refresh interval

Klaus Zanders3c78edc58720
diff --git a/modules/meeting/app/services/meetings/icalendar_builder.rb b/modules/meeting/app/services/meetings/icalendar_builder.rb
index 307561545eb..b9ff20242f6 100644
--- a/modules/meeting/app/services/meetings/icalendar_builder.rb
+++ b/modules/meeting/app/services/meetings/icalendar_builder.rb
@@ -198,6 +198,7 @@ module Meetings
def build_icalendar
::Icalendar::Calendar.new.tap do |calendar|
calendar.prodid = "-//OpenProject GmbH//#{OpenProject::VERSION}//Meeting//EN"
+ calendar.refresh_interval = "PT6H"
end
end
diff --git a/modules/meeting/spec/services/meetings/icalendar_builder_spec.rb b/modules/meeting/spec/services/meetings/icalendar_builder_spec.rb
index 8df05d49561..a79d68a5096 100644
--- a/modules/meeting/spec/services/meetings/icalendar_builder_spec.rb
+++ b/modules/meeting/spec/services/meetings/icalendar_builder_spec.rb
@@ -34,19 +34,24 @@ RSpec.describe Meetings::IcalendarBuilder,
with_settings: { mail_from: "[email protected]", app_title: "OpenProject Testing" } do
let(:timezone) { ActiveSupport::TimeZone["Europe/Berlin"] }
- it "sets the PRODID parameter to the correct value" do
- builder = described_class.new(timezone:)
+ context "without any meetings" do
+ subject(:builder) { described_class.new(timezone:) }
- calendar = Icalendar::Calendar.parse(builder.to_ical).first
- expect(calendar.prodid).to eq("-//OpenProject GmbH//#{OpenProject::VERSION}//Meeting//EN")
- end
+ let(:parsed_calendar) { Icalendar::Calendar.parse(builder.to_ical).first }
- it "allows setting a custom calendar title" do
- builder = described_class.new(timezone:)
- builder.calendar_title = "Custom Title"
+ it "sets the calendar properties" do
+ expect(parsed_calendar.prodid).to eq("-//OpenProject GmbH//#{OpenProject::VERSION}//Meeting//EN")
+ expect(parsed_calendar.version).to eq("2.0")
+ expect(parsed_calendar.calscale).to eq("GREGORIAN")
+ expect(parsed_calendar.refresh_interval.value_ical).to eq("PT6H")
+ end
+
+ it "allows setting a custom calendar title" do
+ builder.calendar_title = "Custom Title"
- calendar = Icalendar::Calendar.parse(builder.to_ical).first
- expect(calendar.x_wr_calname.first).to eq("Custom Title")
+ calendar = Icalendar::Calendar.parse(builder.to_ical).first
+ expect(calendar.x_wr_calname.first).to eq("Custom Title")
+ end
end
context "with a single meeting" do