Sprankelprachtig aan/afmeldsysteem

members_controller_test.rb 987B

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