validate StatusMessage raw_message length
This commit is contained in:
parent
26b7991def
commit
9b3231583d
2 changed files with 10 additions and 0 deletions
|
|
@ -8,6 +8,8 @@ module DiasporaFederation
|
||||||
|
|
||||||
rule :guid, :guid
|
rule :guid, :guid
|
||||||
|
|
||||||
|
rule :raw_message, length: {maximum: 65_535}
|
||||||
|
|
||||||
rule :photos, :not_nil
|
rule :photos, :not_nil
|
||||||
|
|
||||||
rule :public, :boolean
|
rule :public, :boolean
|
||||||
|
|
|
||||||
|
|
@ -24,5 +24,13 @@ module DiasporaFederation
|
||||||
it_behaves_like "a boolean validator" do
|
it_behaves_like "a boolean validator" do
|
||||||
let(:property) { :public }
|
let(:property) { :public }
|
||||||
end
|
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
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue