allow photo.status_message_guid to be nil

This commit is contained in:
Benjamin Neff 2016-01-10 19:05:54 +01:00
parent cf45416344
commit 0917fc2f19
2 changed files with 12 additions and 6 deletions

View file

@ -14,7 +14,7 @@ module DiasporaFederation
rule :remote_photo_name, :not_empty rule :remote_photo_name, :not_empty
rule :status_message_guid, :guid rule :status_message_guid, guid: {nilable: true}
rule :height, :numeric rule :height, :numeric

View file

@ -9,11 +9,17 @@ module DiasporaFederation
let(:mandatory) { true } let(:mandatory) { true }
end end
%i(guid status_message_guid).each do |prop| describe "#guid" do
describe "##{prop}" do it_behaves_like "a guid validator" do
it_behaves_like "a guid validator" do let(:property) { :guid }
let(:property) { prop } end
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
end end