require "test_helper"

class PersonTagsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @person_tag = person_tags(:one)
  end

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

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

  test "should create person_tag" do
    assert_difference("PersonTag.count") do
      post person_tags_url, params: { person_tag: { name: @person_tag.name } }
    end

    assert_redirected_to person_tag_url(PersonTag.last)
  end

  test "should show person_tag" do
    get person_tag_url(@person_tag)
    assert_response :success
  end

  test "should get edit" do
    get edit_person_tag_url(@person_tag)
    assert_response :success
  end

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

  test "should destroy person_tag" do
    assert_difference("PersonTag.count", -1) do
      delete person_tag_url(@person_tag)
    end

    assert_redirected_to person_tags_url
  end
end
