Sprankelprachtig aan/afmeldsysteem

people_controller_test.rb 982B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. require 'test_helper'
  2. class PeopleControllerTest < ActionDispatch::IntegrationTest
  3. setup do
  4. @person = people(:one)
  5. end
  6. test "should get index" do
  7. get people_url
  8. assert_response :success
  9. end
  10. test "should get new" do
  11. get new_person_url
  12. assert_response :success
  13. end
  14. test "should create person" do
  15. assert_difference('Person.count') do
  16. post people_url, params: { person: {} }
  17. end
  18. assert_redirected_to person_url(Person.last)
  19. end
  20. test "should show person" do
  21. get person_url(@person)
  22. assert_response :success
  23. end
  24. test "should get edit" do
  25. get edit_person_url(@person)
  26. assert_response :success
  27. end
  28. test "should update person" do
  29. patch person_url(@person), params: { person: {} }
  30. assert_redirected_to person_url(@person)
  31. end
  32. test "should destroy person" do
  33. assert_difference('Person.count', -1) do
  34. delete person_url(@person)
  35. end
  36. assert_redirected_to people_url
  37. end
  38. end