validate StatusMessage raw_message length

This commit is contained in:
Benjamin Neff 2016-07-04 21:55:11 +02:00
parent 26b7991def
commit 9b3231583d
2 changed files with 10 additions and 0 deletions

View file

@ -8,6 +8,8 @@ module DiasporaFederation
rule :guid, :guid
rule :raw_message, length: {maximum: 65_535}
rule :photos, :not_nil
rule :public, :boolean

View file

@ -24,5 +24,13 @@ module DiasporaFederation
it_behaves_like "a boolean validator" do
let(:property) { :public }
end
describe "#raw_message" do
it_behaves_like "a property with a value validation/restriction" do
let(:property) { :raw_message }
let(:wrong_values) { ["a" * 65_536] }
let(:correct_values) { ["a" * 65_535, nil, ""] }
end
end
end
end