Sprankelprachtig aan/afmeldsysteem

groups_controller_test.rb 1.1KB

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