Sha256: 458179397a2033a26b35a73b3ce9312eccb55538b7142e3915eafd0dec4ae6da

Contents?: true

Size: 1.43 KB

Versions: 3

Compression:

Stored size: 1.43 KB

Contents

require 'helper'

class StepperButtonsTest < ActionController::IntegrationTest
  test "first step should have 'finish later' and 'next step' buttons" do
    get new_company_path
    assert_select "li.next_step" do
      assert_select "input[value='Next step']"
    end
    assert_select "li.save" do
      assert_select "input[value='Finish later']"
    end
    assert_select "li.previous_step", false, "This page must contain no previous button"
  end

  test "second step should have 'finish later', 'previous step' and 'next step' buttons" do
    company = Company.create!(:name => "My company", :my_step => "step1")
    get new_company_path(:id => company.id)

    assert_select "li.next_step" do
      assert_select "input[value='Next step']"
    end

    assert_select "li.save" do
      assert_select "input[value='Finish later']"
    end

    assert_select "li.previous_step" do
      assert_select "input[value='Previous step']"
    end
  end

  test "last step should have 'finish later', 'previous step' and 'finish' buttons" do
    company = Company.create!(:name => "My company", :code => "04108", :my_step => "step2")
    get new_company_path(:id => company.id)

    assert_select "li.finish" do
      assert_select "input[value='Finish form']"
    end

    assert_select "li.save" do
      assert_select "input[value='Finish later']"
    end

    assert_select "li.previous_step" do
      assert_select "input[value='Previous step']"
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
stepper-0.0.4 test/helpers/helper_test.rb
stepper-0.0.3 test/helpers/helper_test.rb
stepper-0.0.1 test/helpers/helper_test.rb