require "test_helper"

class GrabadosControllerTest < ActionDispatch::IntegrationTest
  setup do
    @grabado = grabados(:one)
  end

  test "should get index" do
    get grabados_url
    assert_response :success
  end

  test "should get new" do
    get new_grabado_url
    assert_response :success
  end

  test "should create grabado" do
    assert_difference("Grabado.count") do
      post grabados_url, params: { grabado: { artist_id: @grabado.artist_id, collection_id: @grabado.collection_id, image: @grabado.image, name: @grabado.name, paperh: @grabado.paperh, paperw: @grabado.paperw, plateh: @grabado.plateh, platew: @grabado.platew, state: @grabado.state, style_en: @grabado.style_en, style_es: @grabado.style_es, year: @grabado.year } }
    end

    assert_redirected_to grabado_url(Grabado.last)
  end

  test "should show grabado" do
    get grabado_url(@grabado)
    assert_response :success
  end

  test "should get edit" do
    get edit_grabado_url(@grabado)
    assert_response :success
  end

  test "should update grabado" do
    patch grabado_url(@grabado), params: { grabado: { artist_id: @grabado.artist_id, collection_id: @grabado.collection_id, image: @grabado.image, name: @grabado.name, paperh: @grabado.paperh, paperw: @grabado.paperw, plateh: @grabado.plateh, platew: @grabado.platew, state: @grabado.state, style_en: @grabado.style_en, style_es: @grabado.style_es, year: @grabado.year } }
    assert_redirected_to grabado_url(@grabado)
  end

  test "should destroy grabado" do
    assert_difference("Grabado.count", -1) do
      delete grabado_url(@grabado)
    end

    assert_redirected_to grabados_url
  end
end
