require "test_helper"

class StopWordsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @stop_word = stop_words(:one)
  end

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

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

  test "should create stop_word" do
    assert_difference("StopWord.count") do
      post stop_words_url, params: { stop_word: { word: @stop_word.word } }
    end

    assert_redirected_to stop_word_url(StopWord.last)
  end

  test "should show stop_word" do
    get stop_word_url(@stop_word)
    assert_response :success
  end

  test "should get edit" do
    get edit_stop_word_url(@stop_word)
    assert_response :success
  end

  test "should update stop_word" do
    patch stop_word_url(@stop_word), params: { stop_word: { word: @stop_word.word } }
    assert_redirected_to stop_word_url(@stop_word)
  end

  test "should destroy stop_word" do
    assert_difference("StopWord.count", -1) do
      delete stop_word_url(@stop_word)
    end

    assert_redirected_to stop_words_url
  end
end
