Sha256: aa780de268fba7a08c45b1dc91c8a1eb8d3101d72e3d6ed9a777e9d99dfc55a5

Contents?: true

Size: 1.44 KB

Versions: 2

Compression:

Stored size: 1.44 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 next_step_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 next_step_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

2 entries across 2 versions & 1 rubygems

Version Path
stepper-0.2.0 test/helpers/helper_test.rb
stepper-0.1.0 test/helpers/helper_test.rb