require "application_system_test_case"

class GrabadosTest < ApplicationSystemTestCase
  setup do
    @grabado = grabados(:one)
  end

  test "visiting the index" do
    visit grabados_url
    assert_selector "h1", text: "Grabados"
  end

  test "should create grabado" do
    visit grabados_url
    click_on "New grabado"

    fill_in "Artist", with: @grabado.artist_id
    fill_in "Collection", with: @grabado.collection_id
    fill_in "Image", with: @grabado.image
    fill_in "Name", with: @grabado.name
    fill_in "Paperh", with: @grabado.paperh
    fill_in "Paperw", with: @grabado.paperw
    fill_in "Plateh", with: @grabado.plateh
    fill_in "Platew", with: @grabado.platew
    fill_in "State", with: @grabado.state
    fill_in "Style en", with: @grabado.style_en
    fill_in "Style es", with: @grabado.style_es
    fill_in "Year", with: @grabado.year
    click_on "Create Grabado"

    assert_text "Grabado was successfully created"
    click_on "Back"
  end

  test "should update Grabado" do
    visit grabado_url(@grabado)
    click_on "Edit this grabado", match: :first

    fill_in "Artist", with: @grabado.artist_id
    fill_in "Collection", with: @grabado.collection_id
    fill_in "Image", with: @grabado.image
    fill_in "Name", with: @grabado.name
    fill_in "Paperh", with: @grabado.paperh
    fill_in "Paperw", with: @grabado.paperw
    fill_in "Plateh", with: @grabado.plateh
    fill_in "Platew", with: @grabado.platew
    fill_in "State", with: @grabado.state
    fill_in "Style en", with: @grabado.style_en
    fill_in "Style es", with: @grabado.style_es
    fill_in "Year", with: @grabado.year
    click_on "Update Grabado"

    assert_text "Grabado was successfully updated"
    click_on "Back"
  end

  test "should destroy Grabado" do
    visit grabado_url(@grabado)
    click_on "Destroy this grabado", match: :first

    assert_text "Grabado was successfully destroyed"
  end
end
