diaspora_federation-test 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/diaspora_federation/test.rb +1 -1
- data/lib/diaspora_federation/test/factories.rb +189 -179
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58ecbabeb7e7a99873e81faa4f1bbb843eb552e4
|
4
|
+
data.tar.gz: 2e7161588ee220c786cced85fa11c26358af0578
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f45ac94f3a5ac623a4aab921d4a67ff48bd43d359b36b696239abbf555349aaadda5b9b99f85d97c5f0ef8b50a6b89b6986a109925b08610fc72c6ebe8e164e3
|
7
|
+
data.tar.gz: b9ba391d10aa729f13df6b235688507a3b6a5b06746302147c03b3c7706061b517253403aa1423cd341d2e8409f1dc30f79bd7bb9400119f014475072b5b44d6
|
@@ -23,7 +23,7 @@ module DiasporaFederation
|
|
23
23
|
def self.relayable_attributes_with_signatures(factory_name)
|
24
24
|
klass = FactoryGirl.factory_by_name(factory_name).build_class
|
25
25
|
sort_hash(FactoryGirl.attributes_for(factory_name), klass).tap do |data|
|
26
|
-
DiasporaFederation::Entities::Relayable.update_signatures!(data)
|
26
|
+
DiasporaFederation::Entities::Relayable.update_signatures!(data, klass)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -1,183 +1,193 @@
|
|
1
|
+
require "diaspora_federation"
|
1
2
|
require "factory_girl"
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
4
|
+
module DiasporaFederation
|
5
|
+
module Test
|
6
|
+
module Factories
|
7
|
+
def self.federation_factories
|
8
|
+
FactoryGirl.define do
|
9
|
+
initialize_with { new(attributes) }
|
10
|
+
sequence(:guid) { UUID.generate :compact }
|
11
|
+
sequence(:diaspora_id) {|n| "person-#{n}-#{SecureRandom.hex(3)}@localhost:3000" }
|
12
|
+
sequence(:public_key) { OpenSSL::PKey::RSA.generate(1024).public_key.export }
|
13
|
+
|
14
|
+
factory :webfinger, class: DiasporaFederation::Discovery::WebFinger do
|
15
|
+
guid
|
16
|
+
acct_uri { "acct:#{generate(:diaspora_id)}" }
|
17
|
+
alias_url "http://localhost:3000/people/0123456789abcdef"
|
18
|
+
hcard_url "http://localhost:3000/hcard/users/user"
|
19
|
+
seed_url "http://localhost:3000/"
|
20
|
+
profile_url "http://localhost:3000/u/user"
|
21
|
+
atom_url "http://localhost:3000/public/user.atom"
|
22
|
+
salmon_url "http://localhost:3000/receive/users/0123456789abcdef"
|
23
|
+
public_key
|
24
|
+
subscribe_url "http://localhost:3000/people?q={uri}"
|
25
|
+
end
|
26
|
+
|
27
|
+
factory :h_card, class: DiasporaFederation::Discovery::HCard do
|
28
|
+
guid
|
29
|
+
nickname "some_name"
|
30
|
+
full_name "my name"
|
31
|
+
first_name "my name"
|
32
|
+
last_name nil
|
33
|
+
url "http://localhost:3000/"
|
34
|
+
public_key
|
35
|
+
photo_large_url "/assets/user/default.png"
|
36
|
+
photo_medium_url "/assets/user/default.png"
|
37
|
+
photo_small_url "/assets/user/default.png"
|
38
|
+
searchable true
|
39
|
+
end
|
40
|
+
|
41
|
+
factory :person_entity, class: DiasporaFederation::Entities::Person do
|
42
|
+
guid
|
43
|
+
diaspora_id
|
44
|
+
url "http://localhost:3000/"
|
45
|
+
exported_key { generate(:public_key) }
|
46
|
+
profile {
|
47
|
+
FactoryGirl.build(:profile_entity, diaspora_id: diaspora_id)
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
factory :profile_entity, class: DiasporaFederation::Entities::Profile do
|
52
|
+
diaspora_id
|
53
|
+
first_name "my name"
|
54
|
+
last_name nil
|
55
|
+
image_url "/assets/user/default.png"
|
56
|
+
image_url_medium "/assets/user/default.png"
|
57
|
+
image_url_small "/assets/user/default.png"
|
58
|
+
birthday "1988-07-15"
|
59
|
+
gender "Male"
|
60
|
+
bio "some text about me"
|
61
|
+
location "github"
|
62
|
+
searchable true
|
63
|
+
nsfw false
|
64
|
+
tag_string "#i #love #tags"
|
65
|
+
end
|
66
|
+
|
67
|
+
factory :location_entity, class: DiasporaFederation::Entities::Location do
|
68
|
+
address "Vienna, Austria"
|
69
|
+
lat 48.208174.to_s
|
70
|
+
lng 16.373819.to_s
|
71
|
+
end
|
72
|
+
|
73
|
+
factory :photo_entity, class: DiasporaFederation::Entities::Photo do
|
74
|
+
guid
|
75
|
+
diaspora_id
|
76
|
+
public(true)
|
77
|
+
created_at { Time.zone.now }
|
78
|
+
remote_photo_path "https://diaspora.example.tld/uploads/images/"
|
79
|
+
remote_photo_name "f2a41e9d2db4d9a199c8.jpg"
|
80
|
+
text "what you see here..."
|
81
|
+
status_message_guid { generate(:guid) }
|
82
|
+
height 480
|
83
|
+
width 800
|
84
|
+
end
|
85
|
+
|
86
|
+
factory :relayable_entity, class: DiasporaFederation::Entities::Relayable do
|
87
|
+
parent_guid { generate(:guid) }
|
88
|
+
end
|
89
|
+
|
90
|
+
factory :participation_entity,
|
91
|
+
class: DiasporaFederation::Entities::Participation, parent: :relayable_entity do
|
92
|
+
guid
|
93
|
+
target_type "Post"
|
94
|
+
diaspora_id
|
95
|
+
end
|
96
|
+
|
97
|
+
factory :status_message_entity, class: DiasporaFederation::Entities::StatusMessage do
|
98
|
+
raw_message "i am a very interesting status update"
|
99
|
+
guid
|
100
|
+
diaspora_id
|
101
|
+
public(true)
|
102
|
+
created_at { Time.zone.now }
|
103
|
+
end
|
104
|
+
|
105
|
+
factory :request_entity, class: DiasporaFederation::Entities::Request do
|
106
|
+
sender_id { generate(:diaspora_id) }
|
107
|
+
recipient_id { generate(:diaspora_id) }
|
108
|
+
end
|
109
|
+
|
110
|
+
factory :comment_entity, class: DiasporaFederation::Entities::Comment, parent: :relayable_entity do
|
111
|
+
guid
|
112
|
+
text "this is a very informative comment"
|
113
|
+
diaspora_id
|
114
|
+
end
|
115
|
+
|
116
|
+
factory :like_entity, class: DiasporaFederation::Entities::Like, parent: :relayable_entity do
|
117
|
+
positive true
|
118
|
+
guid
|
119
|
+
target_type "Post"
|
120
|
+
diaspora_id
|
121
|
+
end
|
122
|
+
|
123
|
+
factory :account_deletion_entity, class: DiasporaFederation::Entities::AccountDeletion do
|
124
|
+
diaspora_id
|
125
|
+
end
|
126
|
+
|
127
|
+
factory :conversation_entity, class: DiasporaFederation::Entities::Conversation do
|
128
|
+
guid
|
129
|
+
subject "this is a very informative subject"
|
130
|
+
created_at { DateTime.now.utc }
|
131
|
+
messages []
|
132
|
+
diaspora_id
|
133
|
+
participant_ids { 3.times.map { generate(:diaspora_id) }.join(";") }
|
134
|
+
end
|
135
|
+
|
136
|
+
factory :message_entity, class: DiasporaFederation::Entities::Message, parent: :relayable_entity do
|
137
|
+
guid
|
138
|
+
text "this is a very informative text"
|
139
|
+
created_at { DateTime.now.utc }
|
140
|
+
diaspora_id
|
141
|
+
conversation_guid { generate(:guid) }
|
142
|
+
end
|
143
|
+
|
144
|
+
factory :relayable_retraction_entity, class: DiasporaFederation::Entities::RelayableRetraction do
|
145
|
+
target_guid { generate(:guid) }
|
146
|
+
target_type "Comment"
|
147
|
+
diaspora_id
|
148
|
+
end
|
149
|
+
|
150
|
+
factory :reshare_entity, class: DiasporaFederation::Entities::Reshare do
|
151
|
+
root_diaspora_id { generate(:diaspora_id) }
|
152
|
+
root_guid { generate(:guid) }
|
153
|
+
guid
|
154
|
+
diaspora_id
|
155
|
+
public(true)
|
156
|
+
created_at { DateTime.now.utc }
|
157
|
+
provider_display_name { "the testsuite" }
|
158
|
+
end
|
159
|
+
|
160
|
+
factory :retraction_entity, class: DiasporaFederation::Entities::Retraction do
|
161
|
+
target_guid { generate(:guid) }
|
162
|
+
diaspora_id
|
163
|
+
target_type "Post"
|
164
|
+
end
|
165
|
+
|
166
|
+
factory :signed_retraction_entity, class: DiasporaFederation::Entities::SignedRetraction do
|
167
|
+
target_guid { generate(:guid) }
|
168
|
+
target_type "Post"
|
169
|
+
diaspora_id
|
170
|
+
end
|
171
|
+
|
172
|
+
factory :poll_answer_entity, class: DiasporaFederation::Entities::PollAnswer do
|
173
|
+
guid
|
174
|
+
answer { "Obama is a bicycle" }
|
175
|
+
end
|
176
|
+
|
177
|
+
factory :poll_entity, class: DiasporaFederation::Entities::Poll do
|
178
|
+
guid
|
179
|
+
question { "Select an answer" }
|
180
|
+
poll_answers { 3.times.map { FactoryGirl.build(:poll_answer_entity) } }
|
181
|
+
end
|
182
|
+
|
183
|
+
factory :poll_participation_entity,
|
184
|
+
class: DiasporaFederation::Entities::PollParticipation, parent: :relayable_entity do
|
185
|
+
guid
|
186
|
+
diaspora_id
|
187
|
+
poll_answer_guid { generate(:guid) }
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
182
192
|
end
|
183
193
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: diaspora_federation-test
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Neff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diaspora_federation
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.
|
19
|
+
version: 0.0.10
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.
|
26
|
+
version: 0.0.10
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: factory_girl
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|