Sha256: 2a64806806f1e76422ee1be78499d0770f8c7691d6ea0b86d30adff3abf162c2

Contents?: true

Size: 1.61 KB

Versions: 5

Compression:

Stored size: 1.61 KB

Contents

require 'test_helper'

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))
    assert has_content?(step.to_s)
  end

  test 'show second' do
    step = :second
    visit(foo_path(step))
    assert has_content?(step.to_s)
  end

  test 'skip first' do
    step = :first
    visit(foo_path(step.to_s, :skip_step => 'true'))
    assert has_content?('second')
  end

  test 'invalid step' do
    step = :notastep
    assert_raise(ActionView::MissingTemplate) do
      visit(foo_path(step))
    end
  end

  test 'finish' do
    step = :finish
    visit(foo_path(step))
    assert has_content?('home')
  end

end


class IncludeNavigationTest < ActiveSupport::IntegrationCase

  test 'show first' do
    step = :first
    visit(bar_path(step))
    assert has_content?(step.to_s)
  end

  test 'show second' do
    step = :second
    visit(bar_path(step))
    assert has_content?(step.to_s)
  end

  test 'skip first' do
    step = :first
    visit(bar_path(step, :skip_step => 'true'))
    assert has_content?(:second.to_s)
  end

  test 'pointer to first' do
    visit(bar_path(:wizard_first))
    assert has_content?('first')
  end

  test 'pointer to last' do
    visit(bar_path(:wizard_last))
    assert has_content?('last_step')
  end

  test 'invalid step' do
    step = :notastep
    assert_raise(ActionView::MissingTemplate) do
      visit(bar_path(step))
    end
  end

  test 'finish' do
    step = :finish
    visit(bar_path(step))
    assert has_content?('home')
  end
end


Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
wicked-0.3.1 test/integration/navigation_test.rb
wicked-0.3.0 test/integration/navigation_test.rb
wicked-focused-0.2.0 test/integration/navigation_test.rb
wicked-0.2.0 test/integration/navigation_test.rb
wicked-0.1.6 test/integration/navigation_test.rb