From fd93a9c871e0c758603b5a939dc192aeefddab1d Mon Sep 17 00:00:00 2001 From: Jennifer Glauche <=^.^=@github19.jglauche.de> Date: Sat, 16 Nov 2019 19:02:09 +0100 Subject: make it not return http 400 when passing and empty source argument (#12259) * make it not return http 400 when passing and empty source argument * create a spec for the empty source hash bug * compact checks for nil, empty? parameters * use nil.blank? instead checking for nil --- .../api/v1/accounts/credentials_controller_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'spec/controllers/api/v1/accounts/credentials_controller_spec.rb') diff --git a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb index 19ac32612..ebd462a03 100644 --- a/spec/controllers/api/v1/accounts/credentials_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/credentials_controller_spec.rb @@ -59,6 +59,19 @@ describe Api::V1::Accounts::CredentialsController do end end + describe 'with empty source list' do + before do + patch :update, params: { + display_name: "I'm a cat", + source: {}, + }, as: :json + end + + it 'returns http success' do + expect(response).to have_http_status(200) + end + end + describe 'with invalid data' do before do patch :update, params: { note: 'This is too long. ' * 30 } -- cgit