From d33aa8b7578b9bec05df1feb1477e3804b727d51 Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Mon, 9 Mar 2026 21:53:43 -0700 Subject: [PATCH] Wrap params coverage nits (#2681) * Add missing assert_response to signup API test * Add JSON response format to joins#create --- app/controllers/users/joins_controller.rb | 6 +++++- test/controllers/api/flat_json_params_test.rb | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) 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