Sha256: 5e15b93e9088227945cd59d6074bf2fcca1c16088d6e510ddd6c477a613882f1

Contents?: true

Size: 849 Bytes

Versions: 1

Compression:

Stored size: 849 Bytes

Contents

require "rails_helper"
feature "select boxes" do
  before(:each) { create(:mass_address) }

  scenario "load page", js: true do
    visit "/"
    expect(page).to have_content "Addresses Demo"

    expect(page).to have_select(
      "address_country",
      with_options: ["United States", "India"]
    )

    expect(page).to have_select(
      "address_subdivision",
      with_options: ["Alaska", "Wyoming", "Massachusetts"]
    )
  end

  scenario "click Guam", js: true do
    visit "/"

    select "Guam", from: "Country"
    expect(page).to have_select(
      "address_subdivision",
      disabled: true
    )
  end

  scenario "click Germany", js: true do
    visit "/"

    select "Germany", from: "Country"
    expect(page).to have_select(
      "address_subdivision",
      with_options: ["", "Berlin", "Hamburg", "Bayern"]
    )
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
subdivision_select-0.0.2 spec/test_app/spec/features/select_boxes_spec.rb