about summary refs log tree commit diff
path: root/spec/controllers/api
diff options
context:
space:
mode:
authorJennifer Glauche <=^.^=@github19.jglauche.de>2019-11-16 19:02:09 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-11-16 19:02:09 +0100
commitfd93a9c871e0c758603b5a939dc192aeefddab1d (patch)
tree5a43a1a5312a254bb28eef1b80788a23fd7b6083 /spec/controllers/api
parent286bf45d4cae7e6ea2c9164d861f020df6fa2a43 (diff)
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
Diffstat (limited to 'spec/controllers/api')
-rw-r--r--spec/controllers/api/v1/accounts/credentials_controller_spec.rb13
1 files changed, 13 insertions, 0 deletions
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 }