Sha256: 1312d6c06173a570caf17938173b1bf1441797edd2f9e0a5ced98787b65ff986

Contents?: true

Size: 1.31 KB

Versions: 8

Compression:

Stored size: 1.31 KB

Contents

require 'test_helper'

module TodoRails
  class TasksControllerTest < ActionController::TestCase
    setup do
      @task = todo_rails_tasks(:one)
      @routes = Engine.routes
    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: { comment: @task.comment, completed: @task.completed, priority: @task.priority, row_order: @task.row_order, title: @task.title }
      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: { comment: @task.comment, completed: @task.completed, priority: @task.priority, row_order: @task.row_order, title: @task.title }
      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
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
todo_rails-0.1.7 test/controllers/todo_rails/tasks_controller_test.rb
todo_rails-0.1.6 test/controllers/todo_rails/tasks_controller_test.rb
todo_rails-0.1.5 test/controllers/todo_rails/tasks_controller_test.rb
todo_rails-0.1.4 test/controllers/todo_rails/tasks_controller_test.rb
todo_rails-0.1.3 test/controllers/todo_rails/tasks_controller_test.rb
todo_rails-0.1.2 test/controllers/todo_rails/tasks_controller_test.rb
todo_rails-0.1.1 test/controllers/todo_rails/tasks_controller_test.rb
todo_rails-0.1.0 test/controllers/todo_rails/tasks_controller_test.rb