Fix incorrect value for feature_approval.current_user for local users (#38751)

This commit is contained in:
Claire authored and GitHub committed 2026-04-20 16:00:15 +00:00
1 parent c0b1fbe0a9
commit ccf5c09ad3
3 files changed
+23 -8

No files matched your search

@@ -97,12 +97,26 @@ RSpec.describe REST::AccountSerializer do
context 'when account is locked' do
let(:account) { Fabricate(:account, locked: true) }
it 'includes a policy that allows featuring for followers' do
expect(subject['feature_approval']).to include({
'automatic' => ['followers'],
'manual' => [],
'current_user' => 'automatic',
})
context 'when the current account does not follow the user' do
it 'includes a policy that allows featuring for followers and has "denied" for the current user' do
expect(subject['feature_approval']).to include({
'automatic' => ['followers'],
'manual' => [],
'current_user' => 'denied',
})
end
end
context 'when the current account follows the user' do
before { current_user.account.follow!(account) }
it 'includes a policy that allows featuring for followers and has "automatic" for the current user' do
expect(subject['feature_approval']).to include({
'automatic' => ['followers'],
'manual' => [],
'current_user' => 'automatic',
})
end
end
end
end