require "application_system_test_case"

class ShippingBoxesTest < ApplicationSystemTestCase
  setup do
    @shipping_box = shipping_boxes(:one)
  end

  test "visiting the index" do
    visit shipping_boxes_url
    assert_selector "h1", text: "Shipping Boxes"
  end

  test "creating a Shipping box" do
    visit shipping_boxes_url
    click_on "New Shipping Box"

    fill_in "Box", with: @shipping_box.box_id
    fill_in "Lot no", with: @shipping_box.lot_no
    fill_in "Part desc", with: @shipping_box.part_desc
    fill_in "Part no", with: @shipping_box.part_no
    fill_in "Po", with: @shipping_box.po
    fill_in "Qty", with: @shipping_box.qty
    fill_in "Supplier", with: @shipping_box.supplier
    click_on "Create Shipping box"

    assert_text "Shipping box was successfully created"
    click_on "Back"
  end

  test "updating a Shipping box" do
    visit shipping_boxes_url
    click_on "Edit", match: :first

    fill_in "Box", with: @shipping_box.box_id
    fill_in "Lot no", with: @shipping_box.lot_no
    fill_in "Part desc", with: @shipping_box.part_desc
    fill_in "Part no", with: @shipping_box.part_no
    fill_in "Po", with: @shipping_box.po
    fill_in "Qty", with: @shipping_box.qty
    fill_in "Supplier", with: @shipping_box.supplier
    click_on "Update Shipping box"

    assert_text "Shipping box was successfully updated"
    click_on "Back"
  end

  test "destroying a Shipping box" do
    visit shipping_boxes_url
    page.accept_confirm do
      click_on "Destroy", match: :first
    end

    assert_text "Shipping box was successfully destroyed"
  end
end
