parent
5ce71f57d6
commit
1c2e2f560d
5 changed files with 6 additions and 6 deletions
|
|
@ -5,11 +5,11 @@ module DiasporaFederation
|
||||||
#
|
#
|
||||||
# @see Validators::RequestValidator
|
# @see Validators::RequestValidator
|
||||||
class Request < Entity
|
class Request < Entity
|
||||||
# @!attribute [r] sender_id
|
# @!attribute [r] diaspora_id
|
||||||
# The diaspora ID of the person who shares his profile
|
# The diaspora ID of the person who shares his profile
|
||||||
# @see Person#diaspora_id
|
# @see Person#diaspora_id
|
||||||
# @return [String] sender ID
|
# @return [String] sender ID
|
||||||
property :sender_id, xml_name: :sender_handle
|
property :diaspora_id, xml_name: :sender_handle
|
||||||
|
|
||||||
# @!attribute [r] recipient_id
|
# @!attribute [r] recipient_id
|
||||||
# The diaspora ID of the person who will be shared with
|
# The diaspora ID of the person who will be shared with
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ module DiasporaFederation
|
||||||
end
|
end
|
||||||
|
|
||||||
factory :request_entity, class: DiasporaFederation::Entities::Request do
|
factory :request_entity, class: DiasporaFederation::Entities::Request do
|
||||||
sender_id { generate(:diaspora_id) }
|
diaspora_id
|
||||||
recipient_id { generate(:diaspora_id) }
|
recipient_id { generate(:diaspora_id) }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ module DiasporaFederation
|
||||||
class RequestValidator < Validation::Validator
|
class RequestValidator < Validation::Validator
|
||||||
include Validation
|
include Validation
|
||||||
|
|
||||||
rule :sender_id, %i(not_empty diaspora_id)
|
rule :diaspora_id, %i(not_empty diaspora_id)
|
||||||
rule :recipient_id, %i(not_empty diaspora_id)
|
rule :recipient_id, %i(not_empty diaspora_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ module DiasporaFederation
|
||||||
let(:xml) {
|
let(:xml) {
|
||||||
<<-XML
|
<<-XML
|
||||||
<request>
|
<request>
|
||||||
<sender_handle>#{data[:sender_id]}</sender_handle>
|
<sender_handle>#{data[:diaspora_id]}</sender_handle>
|
||||||
<recipient_handle>#{data[:recipient_id]}</recipient_handle>
|
<recipient_handle>#{data[:recipient_id]}</recipient_handle>
|
||||||
</request>
|
</request>
|
||||||
XML
|
XML
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ module DiasporaFederation
|
||||||
|
|
||||||
it_behaves_like "a common validator"
|
it_behaves_like "a common validator"
|
||||||
|
|
||||||
%i(sender_id recipient_id).each do |prop|
|
%i(diaspora_id recipient_id).each do |prop|
|
||||||
describe "##{prop}" do
|
describe "##{prop}" do
|
||||||
it_behaves_like "a diaspora id validator" do
|
it_behaves_like "a diaspora id validator" do
|
||||||
let(:property) { prop }
|
let(:property) { prop }
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue