Sprankelprachtig aan/afmeldsysteem

people_controller_test.rb 1.2KB

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