Sprankelprachtig aan/afmeldsysteem

people_controller_test.rb 1.1KB

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