Sprankelprachtig aan/afmeldsysteem

activities_controller_test.rb 1.0KB

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