Add support for private pinned posts (#16954)
* Add support for private pinned toots * Allow local user to pin private toots * Change wording to avoid "direct message"
This commit is contained in:
		
					parent
					
						
							
								081e4426f8
							
						
					
				
			
			
				commit
				
					
						d5c9feb7b7
					
				
			
		
					 18 changed files with 164 additions and 28 deletions
				
			
		|  | @ -9,7 +9,7 @@ RSpec.describe StatusPinValidator, type: :validator do | |||
|     end | ||||
| 
 | ||||
|     let(:pin) { double(account: account, errors: errors, status: status, account_id: pin_account_id) } | ||||
|     let(:status) { double(reblog?: reblog, account_id: status_account_id, visibility: visibility) } | ||||
|     let(:status) { double(reblog?: reblog, account_id: status_account_id, visibility: visibility, direct_visibility?: visibility == 'direct') } | ||||
|     let(:account)     { double(status_pins: status_pins, local?: local) } | ||||
|     let(:status_pins) { double(count: count) } | ||||
|     let(:errors)      { double(add: nil) } | ||||
|  | @ -37,11 +37,11 @@ RSpec.describe StatusPinValidator, type: :validator do | |||
|       end | ||||
|     end | ||||
| 
 | ||||
|     context 'unless %w(public unlisted).include?(pin.status.visibility)' do | ||||
|       let(:visibility) { '' } | ||||
|     context 'if pin.status.direct_visibility?' do | ||||
|       let(:visibility) { 'direct' } | ||||
| 
 | ||||
|       it 'calls errors.add' do | ||||
|         expect(errors).to have_received(:add).with(:base, I18n.t('statuses.pin_errors.private')) | ||||
|         expect(errors).to have_received(:add).with(:base, I18n.t('statuses.pin_errors.direct')) | ||||
|       end | ||||
|     end | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue