require "application_system_test_case"

class StopWordsTest < ApplicationSystemTestCase
  setup do
    @stop_word = stop_words(:one)
  end

  test "visiting the index" do
    visit stop_words_url
    assert_selector "h1", text: "Stop words"
  end

  test "should create stop word" do
    visit stop_words_url
    click_on "New stop word"

    fill_in "Word", with: @stop_word.word
    click_on "Create Stop word"

    assert_text "Stop word was successfully created"
    click_on "Back"
  end

  test "should update Stop word" do
    visit stop_word_url(@stop_word)
    click_on "Edit this stop word", match: :first

    fill_in "Word", with: @stop_word.word
    click_on "Update Stop word"

    assert_text "Stop word was successfully updated"
    click_on "Back"
  end

  test "should destroy Stop word" do
    visit stop_word_url(@stop_word)
    click_on "Destroy this stop word", match: :first

    assert_text "Stop word was successfully destroyed"
  end
end
