Sha256: e6424caac178f63efc59963c6b548b8ea53e3b0382947f6381db77f23793d1f4

Contents?: true

Size: 1.13 KB

Versions: 5

Compression:

Stored size: 1.13 KB

Contents

require 'helper'

class StepsTest < ActionController::IntegrationTest
  include Capybara::DSL

  test "fill all steps" do
    visit new_company_path
    fill_in "Name", :with => "My company"
    click_button "Next step"
    fill_in "Code", :with => "04108"
    click_button "Next step"
    fill_in "City", :with => "Kiev"
    click_button "Finish form"
    assert_equal page.current_path, company_path(Company.last)
  end


  test "previous step" do
    visit new_company_path
    fill_in "Name", :with => "My company"
    click_button "Next step"
    assert page.has_selector?('label', :text => 'Code')
    click_button "Previous step"
    assert page.has_selector?('label', :text => 'Name')
    assert page.has_selector?('#company_name', :value => 'My company')
    assert page.has_no_selector?('#error_explanation')
  end

  test "finish later" do
    visit new_company_path
    fill_in "Name", :with => "My company"
    click_button "Next step"
    assert page.has_selector?('label', :text => 'Code')
    click_button "Finish later"
    assert_equal page.current_path, companies_path
    assert page.has_no_selector?('#error_explanation')
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
stepper-0.2.0 test/integration/steps_test.rb
stepper-0.1.0 test/integration/steps_test.rb
stepper-0.0.4 test/integration/steps_test.rb
stepper-0.0.3 test/integration/steps_test.rb
stepper-0.0.1 test/integration/steps_test.rb