Request: rename sender_id to diaspora_id

See #29
This commit is contained in:
Benjamin Neff 2016-02-06 21:19:09 +01:00
parent 5ce71f57d6
commit 1c2e2f560d
5 changed files with 6 additions and 6 deletions

View file

@ -5,11 +5,11 @@ module DiasporaFederation
#
# @see Validators::RequestValidator
class Request < Entity
# @!attribute [r] sender_id
# @!attribute [r] diaspora_id
# The diaspora ID of the person who shares his profile
# @see Person#diaspora_id
# @return [String] sender ID
property :sender_id, xml_name: :sender_handle
property :diaspora_id, xml_name: :sender_handle
# @!attribute [r] recipient_id
# The diaspora ID of the person who will be shared with

View file

@ -105,7 +105,7 @@ module DiasporaFederation
end
factory :request_entity, class: DiasporaFederation::Entities::Request do
sender_id { generate(:diaspora_id) }
diaspora_id
recipient_id { generate(:diaspora_id) }
end

View file

@ -4,7 +4,7 @@ module DiasporaFederation
class RequestValidator < Validation::Validator
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)
end
end

View file

@ -5,7 +5,7 @@ module DiasporaFederation
let(:xml) {
<<-XML
<request>
<sender_handle>#{data[:sender_id]}</sender_handle>
<sender_handle>#{data[:diaspora_id]}</sender_handle>
<recipient_handle>#{data[:recipient_id]}</recipient_handle>
</request>
XML

View file

@ -4,7 +4,7 @@ module DiasporaFederation
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
it_behaves_like "a diaspora id validator" do
let(:property) { prop }