Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

36 lines (28 sloc) 0.844 kb
require 'test_helper'
class TasksControllerTest < ActionController::TestCase
setup do
@list = lists(:one)
@task = tasks(:one)
end
test "should get index" do
get :index
assert_response :success
assert_not_nil assigns(:lists)
end
test "should create task" do
assert_difference('Task.count') do
post :create, :task => @task.attributes, :list_id => @list.id
end
assert_redirected_to list_tasks_path(@list)
end
test "should update task" do
put :update, :id => @task.to_param, :task => @task.attributes, :list_id => @list.id
assert_redirected_to list_tasks_path(@list)
end
test "should destroy task" do
assert_difference('Task.count', -1) do
delete :destroy, :id => @task.to_param, :list_id => @list.id
end
assert_redirected_to list_tasks_path(@list)
end
end
Jump to Line
Something went wrong with that request. Please try again.