Skip to content

Commit

Permalink
default index to first wizard step
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Apr 1, 2012
1 parent f9dca72 commit f7d2908
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/wicked/wizard.rb
Expand Up @@ -14,6 +14,10 @@ module Wizard
before_filter :setup_wizard
end

def index
redirect_to wizard_path(steps.first)
end

private
def setup_wizard
@step = params[:id].try(:to_sym) || steps.first
Expand Down
6 changes: 6 additions & 0 deletions test/integration/navigation_test.rb
Expand Up @@ -2,6 +2,12 @@

class InheritNavigationTest < ActiveSupport::IntegrationCase

test 'default index' do
visit(foo_index_path)
assert has_content?('first')
end


test 'show first' do
step = :first
visit(foo_path(step))
Expand Down

0 comments on commit f7d2908

Please sign in to comment.