Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Dec 4, 2024
1 parent 52470d8 commit 6d200d4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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

Expand Down
15 changes: 14 additions & 1 deletion modules/meeting/spec/support/pages/recurring_meeting/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down

0 comments on commit 6d200d4

Please sign in to comment.