Sha256: f6009851b61cbc53841ee5ffbb7e8cc9265264927c9b03382acf3f57efcb7ed4

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 KB

Contents

require 'test_helper'

class PeopleControllerTest < ActionController::TestCase
  
  fixtures :all
  
  setup do
    @person = people(:kevin)
  end
  
  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:people)
  end
  
  test "should get new" do
    get :new
    assert_response :success
  end
  
  test "should create person" do
    assert_difference('Person.count') do
      post :create, :person => @person.attributes
    end
    
    assert_redirected_to person_path(assigns(:person))
  end
  
  test "should show person" do
    get :show, :id => @person.id
    assert_response :success
  end
  
  test "should get edit" do
    get :edit, :id => @person.id
    assert_response :success
  end
  
  test "should update person" do
    put :update, :id => @person.id, :person => @person.attributes
    assert_redirected_to person_path(assigns(:person))
  end
  
  test "should destroy person" do
    assert_difference('Person.count', -1) do
      delete :destroy, :id => @person.id
    end
    
    assert_redirected_to people_path
  end
  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
erroneous-0.1.1 test/dummy/test/functional/people_controller_test.rb
erroneous-0.1.0 test/dummy/test/functional/people_controller_test.rb
erroneous-0.0.8 test/dummy/test/functional/people_controller_test.rb
erroneous-0.0.7 test/dummy/test/functional/people_controller_test.rb
erroneous-0.0.6 test/dummy/test/functional/people_controller_test.rb