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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Handle edge case
Mir Bhatiaf7e4bdc3d806
diff --git a/modules/meeting/app/controllers/recurring_meetings_controller.rb b/modules/meeting/app/controllers/recurring_meetings_controller.rbindex 1c36538c857..b2d5f179aad 100644--- a/modules/meeting/app/controllers/recurring_meetings_controller.rb+++ b/modules/meeting/app/controllers/recurring_meetings_controller.rb@@ -288,7 +288,8 @@ class RecurringMeetingsController < ApplicationControllerelsif @recurring_meeting.will_end?open = @recurring_meeting.upcoming_instantiated_meetingsongoing = @recurring_meeting.ongoing_meetings- @recurring_meeting.remaining_occurrences.count - open.count + ongoing.count+ total = @recurring_meeting.remaining_occurrences.count - open.count + ongoing.count+ [total, 0].maxend@count = [show_more_limit_param, @max_count].compact.mindiff --git a/modules/meeting/spec/requests/recurring_meetings/recurring_meetings_show_spec.rb b/modules/meeting/spec/requests/recurring_meetings/recurring_meetings_show_spec.rbindex 3931c8374f4..423503d695b 100644--- a/modules/meeting/spec/requests/recurring_meetings/recurring_meetings_show_spec.rb+++ b/modules/meeting/spec/requests/recurring_meetings/recurring_meetings_show_spec.rb@@ -190,6 +190,57 @@ RSpec.describe "Recurring meetings show",endend+ context "with an edited meeting series" do+ let(:recurring_meeting) do+ create :recurring_meeting,+ project:,+ author: user,+ start_time: Time.zone.today + 2.days + 10.hours,+ frequency: "daily",+ end_after: "iterations",+ iterations: 2+ end+ let!(:first_instance) do+ create :structured_meeting,+ recurring_meeting:,+ start_time: Time.zone.today + 2.days + 10.hours,+ state: :open+ end+ let!(:first) do+ create :scheduled_meeting,+ meeting: first_instance,+ recurring_meeting:,+ start_time: Time.zone.today + 2.days + 10.hours+ end+ let!(:second_instance) do+ create :structured_meeting,+ recurring_meeting:,+ start_time: Time.zone.today + 3.days + 10.hours,+ state: :open+ end+ let!(:second) do+ create :scheduled_meeting,+ meeting: second_instance,+ recurring_meeting:,+ start_time: Time.zone.today + 3.days + 10.hours+ end++ before do+ recurring_meeting.update(iterations: 1)+ end++ it "shows all open meetings in 'Open', even if they no longer match the schedule (Regression #61301)" do+ get recurring_meeting_path(recurring_meeting)++ first_date = format_time(first.start_time)+ second_date = format_time(second.start_time)++ open = page.find("[data-test-selector='agenda-opened-table']")+ expect(open).to have_text first_date+ expect(open).to have_text second_date+ end+ end+context "with a cancelled meeting" dolet!(:rescheduled) docreate :scheduled_meeting,