Sha256: 42af68ccf4620be2ed0e8b13765d73e8143eca29bf07af9dc26e07ddf3bb6fd9

Contents?: true

Size: 1.08 KB

Versions: 2

Compression:

Stored size: 1.08 KB

Contents

require 'test_helper'

class TasksControllerTest < ActionController::TestCase
  setup do
    @task = tasks(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:tasks)
  end

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

  test "should create task" do
    assert_difference('Task.count') do
      post :create, task: { description: @task.description, name: @task.name, project_id: @task.project_id }
    end

    assert_redirected_to task_path(assigns(:task))
  end

  test "should show task" do
    get :show, id: @task
    assert_response :success
  end

  test "should get edit" do
    get :edit, id: @task
    assert_response :success
  end

  test "should update task" do
    patch :update, id: @task, task: { description: @task.description, name: @task.name, project_id: @task.project_id }
    assert_redirected_to task_path(assigns(:task))
  end

  test "should destroy task" do
    assert_difference('Task.count', -1) do
      delete :destroy, id: @task
    end

    assert_redirected_to tasks_path
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rack-allocation_stats-0.1.1 ./demo_rack_apps/Rails_4.0.1/test/controllers/tasks_controller_test.rb
rack-allocation_stats-0.1.0 ./demo_rack_apps/Rails_4.0.1/test/controllers/tasks_controller_test.rb