Skip to content

Commit

Permalink
Order participations before expecting to make spec more resilient
Browse files Browse the repository at this point in the history
  • Loading branch information
amaierhofer committed Nov 19, 2024
1 parent 485c0c7 commit 14c4c6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/models/event/course_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,9 @@
it "changes participation states to canceled" do
expect(course.participations.count).to eq(3)
course.update!(state: :canceled, canceled_reason: :minimum_participants)
participations = course.participations.reload
expect(participations.map(&:state)).to eq(%w[assigned annulled annulled])
expect(participations.map(&:previous_state)).to eq([nil, "assigned", "rejected"])
participations = course.participations.order(:state)
expect(participations.map(&:state)).to eq(%w[annulled annulled assigned])
expect(participations.map(&:previous_state)).to eq(["assigned", "rejected", nil])
end

it "sends an email to all participants if canceled because of minimum participants" do
Expand Down

0 comments on commit 14c4c6e

Please sign in to comment.