validate Photo text length

This commit is contained in:
Benjamin Neff 2016-07-06 23:16:01 +02:00
parent 9b3231583d
commit eb8cdef604
2 changed files with 10 additions and 0 deletions

View file

@ -16,6 +16,8 @@ module DiasporaFederation
rule :status_message_guid, guid: {nilable: true} rule :status_message_guid, guid: {nilable: true}
rule :text, length: {maximum: 65_535}
rule :height, :numeric rule :height, :numeric
rule :width, :numeric rule :width, :numeric

View file

@ -44,5 +44,13 @@ module DiasporaFederation
end end
end 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
end end