zombocom/wicked

past_step? & future_step? do not consider wicked_finish in calculation

artinboghosian opened this issue · 0 comments

I have the following Wicked Controller (unnecessary code removed):

class OnboardingController < ApplicationController
  include Wicked::Wizard

  steps :intro, :register, :jobs, :confirmation

  before_action :skip_registration

  private

  def skip_registration
    return if past_step?(:register)
    
    jump_to(:jobs)
    render_wizard
  end

  def finish_wizard_path
    some_random_url
  end
end

The skip_registration method works properly until the Wizard executes the wicked_finish step. The reason is b/c past_step?(:register) returns false when the step name is wicked_finish. This seemed unexpected to me, but I don't want to presume. Is it intended behavior that past_step? should return false when step is wicked_finish? I haven't checked but I'm assuming future_step? would have the same issue with any of the internal step names.