require "application_system_test_case"

class RespondentCategoriesTest < ApplicationSystemTestCase
  setup do
    @respondent_category = respondent_categories(:one)
  end

  test "visiting the index" do
    visit respondent_categories_url
    assert_selector "h1", text: "Respondent categories"
  end

  test "should create respondent category" do
    visit respondent_categories_url
    click_on "New respondent category"

    fill_in "Name", with: @respondent_category.name
    fill_in "Project", with: @respondent_category.project_id
    click_on "Create Respondent category"

    assert_text "Respondent category was successfully created"
    click_on "Back"
  end

  test "should update Respondent category" do
    visit respondent_category_url(@respondent_category)
    click_on "Edit this respondent category", match: :first

    fill_in "Name", with: @respondent_category.name
    fill_in "Project", with: @respondent_category.project_id
    click_on "Update Respondent category"

    assert_text "Respondent category was successfully updated"
    click_on "Back"
  end

  test "should destroy Respondent category" do
    visit respondent_category_url(@respondent_category)
    click_on "Destroy this respondent category", match: :first

    assert_text "Respondent category was successfully destroyed"
  end
end
