Sha256: 1dba3484d8d621d9072ee15486b29d093a70e279135d3f15046e0f9341171779

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

require 'test_helper'

class TutorialsControllerTest < ActionDispatch::IntegrationTest
  setup do
    @tutorial = tutorials(:one)
  end

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

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

  test "should create tutorial" do
    assert_difference('Tutorial.count') do
      post tutorials_url, params: { tutorial: {  } }
    end

    assert_redirected_to tutorial_url(Tutorial.last)
  end

  test "should show tutorial" do
    get tutorial_url(@tutorial)
    assert_response :success
  end

  test "should get edit" do
    get edit_tutorial_url(@tutorial)
    assert_response :success
  end

  test "should update tutorial" do
    patch tutorial_url(@tutorial), params: { tutorial: {  } }
    assert_redirected_to tutorial_url(@tutorial)
  end

  test "should destroy tutorial" do
    assert_difference('Tutorial.count', -1) do
      delete tutorial_url(@tutorial)
    end

    assert_redirected_to tutorials_url
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_org-0.0.1 test/controllers/tutorials_controller_test.rb