Refactor settings controllers (#14767)
- Disallow suspended accounts from revoking sessions and apps - Allow suspended accounts to access exports
This commit is contained in:
		
					parent
					
						
							
								e6b272e5c9
							
						
					
				
			
			
				commit
				
					
						4e4b3a0c8e
					
				
			
		
					 31 changed files with 65 additions and 118 deletions
				
			
		|  | @ -77,6 +77,20 @@ describe Settings::DeletesController do | |||
|           expect(response).to redirect_to settings_delete_path | ||||
|         end | ||||
|       end | ||||
| 
 | ||||
|       context 'when account deletions are disabled' do | ||||
|         around do |example| | ||||
|           open_deletion = Setting.open_deletion | ||||
|           example.run | ||||
|           Setting.open_deletion = open_deletion | ||||
|         end | ||||
| 
 | ||||
|         it 'redirects' do | ||||
|           Setting.open_deletion = false | ||||
|           delete :destroy | ||||
|           expect(response).to redirect_to root_path | ||||
|         end | ||||
|       end | ||||
|     end | ||||
| 
 | ||||
|     context 'when not signed in' do | ||||
|  | @ -85,19 +99,5 @@ describe Settings::DeletesController do | |||
|         expect(response).to redirect_to '/auth/sign_in' | ||||
|       end | ||||
|     end | ||||
| 
 | ||||
|     context do | ||||
|       around do |example| | ||||
|         open_deletion = Setting.open_deletion | ||||
|         example.run | ||||
|         Setting.open_deletion = open_deletion | ||||
|       end | ||||
| 
 | ||||
|       it 'redirects' do | ||||
|         Setting.open_deletion = false | ||||
|         delete :destroy | ||||
|         expect(response).to redirect_to root_path | ||||
|       end | ||||
|     end | ||||
|   end | ||||
| end | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue