From 6d200d4c29ea3322ac37c1b52dc27ad77b25dba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20G=C3=BCnther?= Date: Wed, 4 Dec 2024 10:46:03 +0100 Subject: [PATCH] Fix specs --- .../recurring_meeting_crud_spec.rb | 23 ++++--------------- .../support/pages/recurring_meeting/show.rb | 15 +++++++++++- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/meeting/spec/features/recurring_meetings/recurring_meeting_crud_spec.rb b/modules/meeting/spec/features/recurring_meetings/recurring_meeting_crud_spec.rb index fe7b94d500ac..8b5c4e8bcdb3 100644 --- a/modules/meeting/spec/features/recurring_meetings/recurring_meeting_crud_spec.rb +++ b/modules/meeting/spec/features/recurring_meetings/recurring_meeting_crud_spec.rb @@ -72,21 +72,9 @@ before do login_as current_user - end - - it "can create a recurring meeting" do - expect_flash(type: :success, message: "Successful creation.") - - # Does not send invitation mails by default - expect(ActionMailer::Base.deliveries.size).to eq 0 - - show_page.visit! - expect(page).to have_css(".start_time", count: 3) - - show_page.expect_open_meeting date: "12/31/2024 01:30 PM" - show_page.expect_scheduled_meeting date: "01/07/2025 01:30 PM" - show_page.expect_scheduled_meeting date: "01/14/2025 01:30 PM" + # Assuming the first init job has run + RecurringMeetings::InitNextOccurrenceJob.perform_now(meeting) end it "can delete a recurring meeting from the show page and return to the index page" do @@ -124,7 +112,7 @@ expect_flash(type: :success, message: "Successful cancellation.") - expect(page).to have_current_path(show_page.path) # check path + expect(page).to have_current_path(show_page.project_path) show_page.expect_no_open_meeting date: "12/31/2024 01:30 PM" show_page.expect_cancelled_meeting date: "12/31/2024 01:30 PM" @@ -133,7 +121,7 @@ it "can edit the details of a recurring meeting" do show_page.visit! - show_page.expect_subtitle text: "Weekly on Tuesday at 01:30 PM, ends on 01/15/2025" + show_page.expect_subtitle text: "Weekly on Tuesday at 01:30 PM, ends on 01/14/2025" show_page.edit_meeting_series show_page.in_edit_dialog do @@ -144,8 +132,7 @@ click_on("Save") end - - show_page.refresh # check refresh + wait_for_network_idle show_page.expect_subtitle text: "Daily at 11:00 AM, ends on 01/07/2025" end diff --git a/modules/meeting/spec/support/pages/recurring_meeting/show.rb b/modules/meeting/spec/support/pages/recurring_meeting/show.rb index 1e02ec016771..90611881d1a5 100644 --- a/modules/meeting/spec/support/pages/recurring_meeting/show.rb +++ b/modules/meeting/spec/support/pages/recurring_meeting/show.rb @@ -42,6 +42,10 @@ def path recurring_meeting_path(meeting) end + def project_path + project_recurring_meeting_path(meeting.project, meeting) + end + def expect_scheduled_meeting(date:) within("li", text: date) do expect(page).to have_css(".status", text: "Scheduled") @@ -114,6 +118,9 @@ def expect_open_actions(date:) expect(page).to have_css(".ActionListItem-label", count: 2) expect(page).to have_css(".ActionListItem-label", text: "Download iCalendar event") expect(page).to have_css(".ActionListItem-label", text: "Cancel this occurrence") + + # Close it again + click_on "more-button" end end @@ -122,7 +129,10 @@ def expect_scheduled_actions(date:) click_on "more-button" expect(page).to have_css(".ActionListItem-label", count: 1) - expect(page).to have_css(".ActionListItem-label", text: "Download iCalendar event") + expect(page).to have_css(".ActionListItem-label", text: "Cancel this occurrence") + + # Close it again + click_on "more-button" end end @@ -132,6 +142,9 @@ def expect_cancelled_actions(date:) expect(page).to have_css(".ActionListItem-label", count: 1) expect(page).to have_css(".ActionListItem-label", text: "Restore this occurrence") + + # Close it again + click_on "more-button" end end