Sprankelprachtig aan/afmeldsysteem

groups_controller_test.rb 960B

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