require "application_system_test_case"

class InterviewQuestionsTest < ApplicationSystemTestCase
  setup do
    @interview_question = interview_questions(:one)
  end

  test "visiting the index" do
    visit interview_questions_url
    assert_selector "h1", text: "Interview questions"
  end

  test "should create interview question" do
    visit interview_questions_url
    click_on "New interview question"

    fill_in "Question", with: @interview_question.question
    fill_in "Respondent category", with: @interview_question.respondent_category_id
    click_on "Create Interview question"

    assert_text "Interview question was successfully created"
    click_on "Back"
  end

  test "should update Interview question" do
    visit interview_question_url(@interview_question)
    click_on "Edit this interview question", match: :first

    fill_in "Question", with: @interview_question.question
    fill_in "Respondent category", with: @interview_question.respondent_category_id
    click_on "Update Interview question"

    assert_text "Interview question was successfully updated"
    click_on "Back"
  end

  test "should destroy Interview question" do
    visit interview_question_url(@interview_question)
    click_on "Destroy this interview question", match: :first

    assert_text "Interview question was successfully destroyed"
  end
end
