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 case of just changing start_time_hour

Oliver Günther510738a8ffb5
diff --git a/modules/meeting/app/contracts/meetings/update_contract.rb b/modules/meeting/app/contracts/meetings/update_contract.rb
index 1ecc5e27f0f..eda675da11e 100644
--- a/modules/meeting/app/contracts/meetings/update_contract.rb
+++ b/modules/meeting/app/contracts/meetings/update_contract.rb
@@ -79,7 +79,7 @@ module Meetings
def check_reschedule?
model.recurring_meeting_id &&
model.scheduled_meeting &&
- model.changed.intersect?(%w[start_time start_date])
+ model.changed.intersect?(%w[start_time start_date start_time_hour])
end
end
end
diff --git a/modules/meeting/spec/services/meetings/update_service_integration_spec.rb b/modules/meeting/spec/services/meetings/update_service_integration_spec.rb
index 7cf63711e16..fbee98f3895 100644
--- a/modules/meeting/spec/services/meetings/update_service_integration_spec.rb
+++ b/modules/meeting/spec/services/meetings/update_service_integration_spec.rb
@@ -88,6 +88,22 @@ RSpec.describe Meetings::UpdateService, "integration", type: :model do
.to include("must be before #{format_time(Time.zone.today + 3.days + 10.hours)}.")
end
end
+
+ context "when moving it later than the start time, then moving only start_time_hour" do
+ let(:params) do
+ { start_time_hour: "09:00" }
+ end
+
+ before do
+ meeting.update_column(:start_time, Time.zone.tomorrow + 11.hours)
+ end
+
+ it "is not valid because needs to be before next occurrence" do
+ expect(service_result).not_to be_success
+ expect(service_result.errors[:start_date])
+ .to include("must be after #{format_time(Time.zone.today + 2.days + 10.hours)}.")
+ end
+ end
end
context "when moving it to the date of the previous schedule" do