diff --git a/app/controllers/users/joins_controller.rb b/app/controllers/users/joins_controller.rb index bbcb039e6..402dd34a3 100644 --- a/app/controllers/users/joins_controller.rb +++ b/app/controllers/users/joins_controller.rb @@ -8,7 +8,11 @@ class Users::JoinsController < ApplicationController def create Current.user.update!(user_params) - redirect_to landing_path + + respond_to do |format| + format.html { redirect_to landing_path } + format.json { head :no_content } + end end private diff --git a/test/controllers/api/flat_json_params_test.rb b/test/controllers/api/flat_json_params_test.rb index 84c4667b4..90f55f8fd 100644 --- a/test/controllers/api/flat_json_params_test.rb +++ b/test/controllers/api/flat_json_params_test.rb @@ -221,6 +221,8 @@ class FlatJsonParamsTest < ActionDispatch::IntegrationTest post signup_path, params: { email_address: email }, as: :json end end + + assert_response :created end test "complete signup with flat JSON" do @@ -242,6 +244,7 @@ class FlatJsonParamsTest < ActionDispatch::IntegrationTest post users_joins_path, params: { name: "Flat Join" }, as: :json + assert_response :no_content assert_equal "Flat Join", users(:david).reload.name end