Sha256: 6d8f0b084c51ed5860a861f10f56819adea704189e56680e61df3261d8162c0d

Contents?: true

Size: 1.76 KB

Versions: 11

Compression:

Stored size: 1.76 KB

Contents

require "test_helper"

module CensorBear
  class StopWordsControllerTest < ActionDispatch::IntegrationTest
    include Engine.routes.url_helpers
    include Devise::Test::IntegrationHelpers

    setup do
      @user = FactoryBot.create(:user)
      sign_in(@user)
      # @stop_word = censor_bear_stop_words(:one)
      @stop_word = FactoryBot.create(:stop_word)
    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", 1) do
        post stop_words_url, params: { stop_word: { dialog: @stop_word.dialog, replacement: @stop_word.replacement, signature: @stop_word.signature, ugc: @stop_word.ugc, nickname: @stop_word.nickname, user_id: @stop_word.user_id, username: @stop_word.username, word: @stop_word.key } }
      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: { dialog: @stop_word.dialog, replacement: @stop_word.replacement, signature: @stop_word.signature, ugc: @stop_word.ugc, user_id: @stop_word.user_id, username: @stop_word.username, word: @stop_word.key } }
      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
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
censor_bear-0.1.29 test/controllers/censor_bear/stop_words_controller_test.rb
censor_bear-0.1.28 test/controllers/censor_bear/stop_words_controller_test.rb
censor_bear-0.1.27 test/controllers/censor_bear/stop_words_controller_test.rb
censor_bear-0.1.26 test/controllers/censor_bear/stop_words_controller_test.rb
censor_bear-0.1.25 test/controllers/censor_bear/stop_words_controller_test.rb
censor_bear-0.1.24 test/controllers/censor_bear/stop_words_controller_test.rb
censor_bear-0.1.23 test/controllers/censor_bear/stop_words_controller_test.rb
censor_bear-0.1.22 test/controllers/censor_bear/stop_words_controller_test.rb
censor_bear-0.1.21 test/controllers/censor_bear/stop_words_controller_test.rb
censor_bear-0.1.20 test/controllers/censor_bear/stop_words_controller_test.rb
censor_bear-0.1.19 test/controllers/censor_bear/stop_words_controller_test.rb