mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
Ingestion of remote collections (#38144)
This commit is contained in:
@@ -8,8 +8,12 @@ RSpec.describe Collection do
|
||||
|
||||
it { is_expected.to validate_presence_of(:name) }
|
||||
|
||||
it { is_expected.to validate_length_of(:name).is_at_most(40) }
|
||||
|
||||
it { is_expected.to validate_presence_of(:description) }
|
||||
|
||||
it { is_expected.to validate_length_of(:description).is_at_most(100) }
|
||||
|
||||
it { is_expected.to_not allow_value(nil).for(:local) }
|
||||
|
||||
it { is_expected.to_not allow_value(nil).for(:sensitive) }
|
||||
@@ -23,10 +27,14 @@ RSpec.describe Collection do
|
||||
context 'when collection is remote' do
|
||||
subject { Fabricate.build :collection, local: false }
|
||||
|
||||
it { is_expected.to validate_length_of(:name).is_at_most(Collection::NAME_LENGTH_HARD_LIMIT) }
|
||||
|
||||
it { is_expected.to_not validate_presence_of(:description) }
|
||||
|
||||
it { is_expected.to validate_presence_of(:description_html) }
|
||||
|
||||
it { is_expected.to validate_length_of(:description_html).is_at_most(Collection::DESCRIPTION_LENGTH_HARD_LIMIT) }
|
||||
|
||||
it { is_expected.to validate_presence_of(:uri) }
|
||||
|
||||
it { is_expected.to validate_presence_of(:original_number_of_items) }
|
||||
|
||||
Reference in New Issue
Block a user