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
This commit is contained in:
		
				
					committed by
					
						
						Eugen Rochko
					
				
			
			
				
	
			
			
			
						parent
						
							286bf45d4c
						
					
				
				
					commit
					fd93a9c871
				
			@@ -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 }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user