require "test_helper"

class RespondentCategoriesControllerTest < ActionDispatch::IntegrationTest
  setup do
    @respondent_category = respondent_categories(:one)
  end

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

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

  test "should create respondent_category" do
    assert_difference("RespondentCategory.count") do
      post respondent_categories_url, params: { respondent_category: { name: @respondent_category.name, project_id: @respondent_category.project_id } }
    end

    assert_redirected_to respondent_category_url(RespondentCategory.last)
  end

  test "should show respondent_category" do
    get respondent_category_url(@respondent_category)
    assert_response :success
  end

  test "should get edit" do
    get edit_respondent_category_url(@respondent_category)
    assert_response :success
  end

  test "should update respondent_category" do
    patch respondent_category_url(@respondent_category), params: { respondent_category: { name: @respondent_category.name, project_id: @respondent_category.project_id } }
    assert_redirected_to respondent_category_url(@respondent_category)
  end

  test "should destroy respondent_category" do
    assert_difference("RespondentCategory.count", -1) do
      delete respondent_category_url(@respondent_category)
    end

    assert_redirected_to respondent_categories_url
  end
end
