allow photo.status_message_guid to be nil
This commit is contained in:
parent
cf45416344
commit
0917fc2f19
2 changed files with 12 additions and 6 deletions
|
|
@ -14,7 +14,7 @@ module DiasporaFederation
|
|||
|
||||
rule :remote_photo_name, :not_empty
|
||||
|
||||
rule :status_message_guid, :guid
|
||||
rule :status_message_guid, guid: {nilable: true}
|
||||
|
||||
rule :height, :numeric
|
||||
|
||||
|
|
|
|||
|
|
@ -9,12 +9,18 @@ module DiasporaFederation
|
|||
let(:mandatory) { true }
|
||||
end
|
||||
|
||||
%i(guid status_message_guid).each do |prop|
|
||||
describe "##{prop}" do
|
||||
describe "#guid" do
|
||||
it_behaves_like "a guid validator" do
|
||||
let(:property) { prop }
|
||||
let(:property) { :guid }
|
||||
end
|
||||
end
|
||||
|
||||
describe "#status_message_guid" do
|
||||
it_behaves_like "a property with a value validation/restriction" do
|
||||
let(:property) { :status_message_guid }
|
||||
let(:wrong_values) { ["aaaaaa", "zzz+-#*$$", ""] }
|
||||
let(:correct_values) { ["1234567890ABCDefgh_ijkl-mnopQR@example.com:3000", nil] }
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like "a boolean validator" do
|
||||
|
|
|
|||
Loading…
Reference in a new issue