Sha256: 4e12eec72bd244d9590d1b8bbb1c459e8976bf7154f5db7d69f289fe2575881b

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

require 'test_helper'

class TopicsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @topic = topics(:one)
  end

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

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

  test "should create topic" do
    assert_difference('Topic.count') do
      post topics_url, params: { topic: { slug: @topic.slug, title: @topic.title + "123", color: @topic.color, views: @topic.views } }
    end

    assert_redirected_to topic_url(Topic.last)
  end

  test "should show topic" do
    get topic_url(@topic)
    assert_response :success
  end

  test "should get edit" do
    get edit_topic_url(@topic)
    assert_response :success
  end

  test "should update topic" do
    patch topic_url(@topic), params: { topic: { slug: @topic.slug, title: @topic.title, color: @topic.color, views: @topic.views } }
    assert_redirected_to topic_url(@topic)
  end

  test "should destroy topic" do
    assert_difference('Topic.count', -1) do
      delete topic_url(@topic)
    end

    assert_redirected_to topics_url
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
friendly_slug-0.1.6 friendly_slug_gem_test/test/controllers/topics_controller_test.rb