Skip to content

Commit

Permalink
add additional states (#583)
Browse files Browse the repository at this point in the history
this is missing the special return text for the buttons.
It might be confusing for the user at this state
  • Loading branch information
Largo committed Jun 19, 2024
1 parent f60bdf8 commit 32ea8cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions app/models/concerns/events/courses/state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ module Events::Courses::State
application_open: [:application_paused, :created, :canceled],
application_paused: [:application_open],
application_closed: [:assignment_closed, :canceled],
assignment_closed: [:ready, :canceled],
ready: [:closed, :canceled],
assignment_closed: [:ready, :application_closed, :canceled],
ready: [:closed, :assignment_closed, :canceled],
canceled: [:application_open],
closed: [:ready]
}.freeze
closed: [:ready] }.freeze

self.possible_states = SAC_COURSE_STATES.keys.collect(&:to_s)

Expand Down
4 changes: 2 additions & 2 deletions spec/models/event/course_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@

it 'lists available states for state :assignment_closed' do
expect(course).to receive(:state).and_return(:assignment_closed)
expect(course.available_states).to eq([:ready, :canceled])
expect(course.available_states).to eq([:ready, :application_closed, :canceled])
end

it 'lists available states for state :ready' do
expect(course).to receive(:state).and_return(:ready)
expect(course.available_states).to eq([:closed, :canceled])
expect(course.available_states).to eq([:closed, :assignment_closed, :canceled])
end

it 'lists available states for state :canceled' do
Expand Down

0 comments on commit 32ea8cb

Please sign in to comment.