require "test_helper"

class ZiyarasControllerTest < ActionDispatch::IntegrationTest
  setup do
    @ziyara = ziyaras(:one)
  end

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

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

  test "should create ziyara" do
    assert_difference("Ziyara.count") do
      post ziyaras_url, params: { ziyara: { name: @ziyara.name } }
    end

    assert_redirected_to ziyara_url(Ziyara.last)
  end

  test "should show ziyara" do
    get ziyara_url(@ziyara)
    assert_response :success
  end

  test "should get edit" do
    get edit_ziyara_url(@ziyara)
    assert_response :success
  end

  test "should update ziyara" do
    patch ziyara_url(@ziyara), params: { ziyara: { name: @ziyara.name } }
    assert_redirected_to ziyara_url(@ziyara)
  end

  test "should destroy ziyara" do
    assert_difference("Ziyara.count", -1) do
      delete ziyara_url(@ziyara)
    end

    assert_redirected_to ziyaras_url
  end
end
