Skip to content

Commit

Permalink
Adapt specs to changed end_time
Browse files Browse the repository at this point in the history
end_time is now end_date start of day, so excluding any meetings on that
day
  • Loading branch information
oliverguenther committed Dec 6, 2024
1 parent 0d09c40 commit 8f169ae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ class RecurringMeetingsController < ApplicationController
include OpTurbo::FlashStreamHelper
include OpTurbo::DialogStreamHelper

before_action :find_meeting, only: %i[show update details_dialog destroy edit init delete_scheduled template_completed download_ics]
before_action :find_meeting,
only: %i[show update details_dialog destroy edit init delete_scheduled template_completed download_ics]
before_action :find_optional_project, only: %i[index show new create update details_dialog destroy edit delete_scheduled]
before_action :authorize_global, only: %i[index new create]
before_action :authorize, except: %i[index new create]
Expand Down
6 changes: 3 additions & 3 deletions modules/meeting/spec/factories/recurring_meeting_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@

# create template
template = create(:structured_meeting_template,
author: recurring_meeting.author,
recurring_meeting:,
project:)
author: recurring_meeting.author,
recurring_meeting:,
project:)

# create agenda item
create(:meeting_agenda_item, meeting: template, title: "My template item")
Expand Down
7 changes: 3 additions & 4 deletions modules/meeting/spec/models/recurring_meeting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

it "schedules daily", :aggregate_failures do
expect(subject.first_occurrence).to eq Time.zone.tomorrow + 10.hours
expect(subject.last_occurrence).to eq Time.zone.tomorrow + 1.week + 10.hours
expect(subject.last_occurrence).to eq Time.zone.tomorrow + 6.days + 10.hours

occurrence_in_two_days = Time.zone.today + 2.days + 10.hours
Timecop.freeze(Time.zone.tomorrow + 11.hours) do
Expand Down Expand Up @@ -106,7 +106,7 @@

it "schedules weekly", :aggregate_failures do
expect(subject.first_occurrence).to eq Time.zone.tomorrow + 10.hours
expect(subject.last_occurrence).to eq Time.zone.tomorrow + 4.weeks + 10.hours
expect(subject.last_occurrence).to eq Time.zone.tomorrow + 3.weeks + 10.hours

following_occurrence = Time.zone.tomorrow + 7.days + 10.hours
Timecop.freeze(Time.zone.tomorrow + 11.hours) do
Expand All @@ -118,8 +118,7 @@
Time.zone.tomorrow + 10.hours,
Time.zone.tomorrow + 7.days + 10.hours,
Time.zone.tomorrow + 14.days + 10.hours,
Time.zone.tomorrow + 21.days + 10.hours,
Time.zone.tomorrow + 28.days + 10.hours
Time.zone.tomorrow + 21.days + 10.hours
]

Timecop.freeze(Time.zone.tomorrow + 5.weeks) do
Expand Down

0 comments on commit 8f169ae

Please sign in to comment.