Sprankelprachtig aan/afmeldsysteem

activities_controller_test.rb 1.2KB

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