ga-wdi-boston / rails-api-bdd

Other
4 stars 131 forks source link

remove JSON Format from solution branch #21

Open BenGitsCode opened 7 years ago

BenGitsCode commented 7 years ago

Remove:

format: :json

raq929 commented 7 years ago

No longer needed in rails 5

danman01 commented 7 years ago

Also present in a few specs in master branch.

Removing before_action that sets request.format = :json from application_controller.rb, too, and things seem to not break on either branch. I don't believe it's needed:

--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -2,11 +2,6 @@
 class ApplicationController < ActionController::API
-  # Force to wants JSON for API
-  before_action :api_request_settings
-  def api_request_settings
-    request.format = :json
-  end

-  private :ssl_configured?, :api_request_settings
+  private :ssl_configured?