diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-01-17 00:49:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-17 00:49:55 +0100 |
commit | d5c9feb7b7fc489afbd0a287431fe07b42451ef0 (patch) | |
tree | 8482c1ac948d10fd0c0a2a17c34c44f2b9b09ad0 /spec/validators | |
parent | 081e4426f8b4f5377afdd6e68e135a3aded93df1 (diff) |
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"
Diffstat (limited to 'spec/validators')
-rw-r--r-- | spec/validators/status_pin_validator_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/validators/status_pin_validator_spec.rb b/spec/validators/status_pin_validator_spec.rb index 06532e5b3f5..d5bd0d1b837 100644 --- a/spec/validators/status_pin_validator_spec.rb +++ b/spec/validators/status_pin_validator_spec.rb @@ -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 |