Merge branch 'main' into glitch-soc/merge-upstream
Conflicts: - `app/controllers/settings/preferences_controller.rb`: Conflicts due to us having more user settings and upstream dropping `hide_network` (to replace it with an account attribute, properly migrated). Dropped `hide_network` like upstream. - `app/lib/user_settings_decorator.rb`: Conflicts due to us having more user settings and upstream dropping `hide_network` (to replace it with an account attribute, properly migrated). Dropped `hide_network` like upstream. - `app/models/status.rb`: Conflict because of slight change in how glitch-soc handles the scope to filter out local-only posts for anonymous viewers. Took upstream's changes and re-applied glitch-soc's change. - `app/models/user.rb`: Conflicts due to us having more user settings and upstream dropping `hide_network` (to replace it with an account attribute, properly migrated). Dropped `hide_network` like upstream. - `app/views/directories/index.html.haml`: Conflict because upstream redesigned that page while glitch-soc had a minor change to support hiding the number of followers. Ported glitch-soc's change on top of upstream's redesign. Additional changes: - `app/models/account_statuses_filter.rb`: See change to `app/models/status.rb`.
This commit is contained in:
@ -435,59 +435,6 @@ RSpec.describe Status, type: :model do
|
||||
end
|
||||
end
|
||||
|
||||
describe '.permitted_for' do
|
||||
subject { described_class.permitted_for(target_account, account).pluck(:visibility) }
|
||||
|
||||
let(:target_account) { alice }
|
||||
let(:account) { bob }
|
||||
let!(:public_status) { Fabricate(:status, account: target_account, visibility: 'public') }
|
||||
let!(:unlisted_status) { Fabricate(:status, account: target_account, visibility: 'unlisted') }
|
||||
let!(:private_status) { Fabricate(:status, account: target_account, visibility: 'private') }
|
||||
|
||||
let!(:direct_status) do
|
||||
Fabricate(:status, account: target_account, visibility: 'direct').tap do |status|
|
||||
Fabricate(:mention, status: status, account: account)
|
||||
end
|
||||
end
|
||||
|
||||
let!(:other_direct_status) do
|
||||
Fabricate(:status, account: target_account, visibility: 'direct').tap do |status|
|
||||
Fabricate(:mention, status: status)
|
||||
end
|
||||
end
|
||||
|
||||
context 'given nil' do
|
||||
let(:account) { nil }
|
||||
let(:direct_status) { nil }
|
||||
it { is_expected.to eq(%w(unlisted public)) }
|
||||
end
|
||||
|
||||
context 'given blocked account' do
|
||||
before do
|
||||
target_account.block!(account)
|
||||
end
|
||||
|
||||
it { is_expected.to be_empty }
|
||||
end
|
||||
|
||||
context 'given same account' do
|
||||
let(:account) { target_account }
|
||||
it { is_expected.to eq(%w(direct direct private unlisted public)) }
|
||||
end
|
||||
|
||||
context 'given followed account' do
|
||||
before do
|
||||
account.follow!(target_account)
|
||||
end
|
||||
|
||||
it { is_expected.to eq(%w(direct private unlisted public)) }
|
||||
end
|
||||
|
||||
context 'given unfollowed account' do
|
||||
it { is_expected.to eq(%w(direct unlisted public)) }
|
||||
end
|
||||
end
|
||||
|
||||
describe 'before_validation' do
|
||||
it 'sets account being replied to correctly over intermediary nodes' do
|
||||
first_status = Fabricate(:status, account: bob)
|
||||
|
Reference in New Issue
Block a user