Add Status::MEDIA_ATTACHMENTS_LIMIT configuration constant (#30433)
This commit is contained in:
@@ -228,14 +228,15 @@ RSpec.describe PostStatusService do
|
||||
expect(media.reload.status).to be_nil
|
||||
end
|
||||
|
||||
it 'does not allow attaching more than 4 files' do
|
||||
it 'does not allow attaching more files than configured limit' do
|
||||
stub_const('Status::MEDIA_ATTACHMENTS_LIMIT', 1)
|
||||
account = Fabricate(:account)
|
||||
|
||||
expect do
|
||||
subject.call(
|
||||
account,
|
||||
text: 'test status update',
|
||||
media_ids: Array.new(5) { Fabricate(:media_attachment, account: account) }.map(&:id)
|
||||
media_ids: Array.new(2) { Fabricate(:media_attachment, account: account) }.map(&:id)
|
||||
)
|
||||
end.to raise_error(
|
||||
Mastodon::ValidationError,
|
||||
|
||||
Reference in New Issue
Block a user