validate Photo text length
This commit is contained in:
parent
9b3231583d
commit
eb8cdef604
2 changed files with 10 additions and 0 deletions
|
|
@ -16,6 +16,8 @@ module DiasporaFederation
|
|||
|
||||
rule :status_message_guid, guid: {nilable: true}
|
||||
|
||||
rule :text, length: {maximum: 65_535}
|
||||
|
||||
rule :height, :numeric
|
||||
|
||||
rule :width, :numeric
|
||||
|
|
|
|||
|
|
@ -44,5 +44,13 @@ module DiasporaFederation
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
describe "#text" do
|
||||
it_behaves_like "a property with a value validation/restriction" do
|
||||
let(:property) { :text }
|
||||
let(:wrong_values) { ["a" * 65_536] }
|
||||
let(:correct_values) { ["a" * 65_535, nil, ""] }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue