Add details to error response for POST /api/v1/accounts in REST API (#15803)
				
					
				
			This commit is contained in:
		@@ -13,7 +13,7 @@ RSpec.describe UnreservedUsernameValidator, type: :validator do
 | 
			
		||||
    let(:account)   { double(username: username, errors: errors) }
 | 
			
		||||
    let(:errors )   { double(add: nil) }
 | 
			
		||||
 | 
			
		||||
    context '@username.nil?' do
 | 
			
		||||
    context '@username.blank?' do
 | 
			
		||||
      let(:username)  { nil }
 | 
			
		||||
 | 
			
		||||
      it 'not calls errors.add' do
 | 
			
		||||
@@ -21,14 +21,14 @@ RSpec.describe UnreservedUsernameValidator, type: :validator do
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    context '!@username.nil?' do
 | 
			
		||||
      let(:username)  { '' }
 | 
			
		||||
    context '!@username.blank?' do
 | 
			
		||||
      let(:username)  { 'f' }
 | 
			
		||||
 | 
			
		||||
      context 'reserved_username?' do
 | 
			
		||||
        let(:reserved_username) { true }
 | 
			
		||||
 | 
			
		||||
        it 'calls erros.add' do
 | 
			
		||||
          expect(errors).to have_received(:add).with(:username, I18n.t('accounts.reserved_username'))
 | 
			
		||||
          expect(errors).to have_received(:add).with(:username, :reserved)
 | 
			
		||||
        end
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user