nelumba 0.0.13
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.
- data/.gitignore +6 -0
- data/.travis.yml +9 -0
- data/Gemfile +20 -0
- data/README.md +242 -0
- data/Rakefile +7 -0
- data/assets/lotus_logo_purple.png +0 -0
- data/assets/lotus_logo_purple.svg +262 -0
- data/lib/nelumba.rb +47 -0
- data/lib/nelumba/activity.rb +250 -0
- data/lib/nelumba/application.rb +11 -0
- data/lib/nelumba/article.rb +11 -0
- data/lib/nelumba/atom/account.rb +50 -0
- data/lib/nelumba/atom/address.rb +56 -0
- data/lib/nelumba/atom/author.rb +176 -0
- data/lib/nelumba/atom/category.rb +41 -0
- data/lib/nelumba/atom/comment.rb +96 -0
- data/lib/nelumba/atom/entry.rb +216 -0
- data/lib/nelumba/atom/feed.rb +198 -0
- data/lib/nelumba/atom/generator.rb +40 -0
- data/lib/nelumba/atom/link.rb +79 -0
- data/lib/nelumba/atom/name.rb +57 -0
- data/lib/nelumba/atom/organization.rb +62 -0
- data/lib/nelumba/atom/person.rb +179 -0
- data/lib/nelumba/atom/portable_contacts.rb +117 -0
- data/lib/nelumba/atom/source.rb +179 -0
- data/lib/nelumba/atom/thread.rb +60 -0
- data/lib/nelumba/audio.rb +39 -0
- data/lib/nelumba/badge.rb +11 -0
- data/lib/nelumba/binary.rb +52 -0
- data/lib/nelumba/bookmark.rb +30 -0
- data/lib/nelumba/category.rb +49 -0
- data/lib/nelumba/collection.rb +34 -0
- data/lib/nelumba/comment.rb +47 -0
- data/lib/nelumba/crypto.rb +144 -0
- data/lib/nelumba/device.rb +11 -0
- data/lib/nelumba/discover.rb +362 -0
- data/lib/nelumba/event.rb +57 -0
- data/lib/nelumba/feed.rb +173 -0
- data/lib/nelumba/file.rb +43 -0
- data/lib/nelumba/generator.rb +53 -0
- data/lib/nelumba/group.rb +11 -0
- data/lib/nelumba/identity.rb +63 -0
- data/lib/nelumba/image.rb +30 -0
- data/lib/nelumba/link.rb +56 -0
- data/lib/nelumba/note.rb +34 -0
- data/lib/nelumba/notification.rb +229 -0
- data/lib/nelumba/object.rb +251 -0
- data/lib/nelumba/person.rb +306 -0
- data/lib/nelumba/place.rb +34 -0
- data/lib/nelumba/product.rb +30 -0
- data/lib/nelumba/publisher.rb +44 -0
- data/lib/nelumba/question.rb +30 -0
- data/lib/nelumba/review.rb +30 -0
- data/lib/nelumba/service.rb +11 -0
- data/lib/nelumba/subscription.rb +117 -0
- data/lib/nelumba/version.rb +3 -0
- data/lib/nelumba/video.rb +43 -0
- data/nelumba.gemspec +28 -0
- data/spec/activity_spec.rb +116 -0
- data/spec/application_spec.rb +136 -0
- data/spec/article_spec.rb +136 -0
- data/spec/atom/comment_spec.rb +455 -0
- data/spec/atom/feed_spec.rb +684 -0
- data/spec/audio_spec.rb +164 -0
- data/spec/badge_spec.rb +136 -0
- data/spec/binary_spec.rb +218 -0
- data/spec/bookmark.rb +150 -0
- data/spec/collection_spec.rb +152 -0
- data/spec/comment_spec.rb +128 -0
- data/spec/crypto_spec.rb +126 -0
- data/spec/device_spec.rb +136 -0
- data/spec/event_spec.rb +239 -0
- data/spec/feed_spec.rb +252 -0
- data/spec/file_spec.rb +190 -0
- data/spec/group_spec.rb +136 -0
- data/spec/helper.rb +10 -0
- data/spec/identity_spec.rb +67 -0
- data/spec/image_spec.rb +150 -0
- data/spec/link_spec.rb +30 -0
- data/spec/note_spec.rb +163 -0
- data/spec/notification_spec.rb +89 -0
- data/spec/person_spec.rb +244 -0
- data/spec/place_spec.rb +162 -0
- data/spec/product_spec.rb +150 -0
- data/spec/question_spec.rb +156 -0
- data/spec/review_spec.rb +149 -0
- data/spec/service_spec.rb +136 -0
- data/spec/video_spec.rb +164 -0
- data/test/example_feed.atom +393 -0
- data/test/example_feed_empty_author.atom +336 -0
- data/test/example_feed_false_connected.atom +359 -0
- data/test/example_feed_link_without_href.atom +134 -0
- data/test/example_page.html +4 -0
- data/test/mime_type_bug_feed.atom +874 -0
- metadata +288 -0
@@ -0,0 +1,136 @@
|
|
1
|
+
require_relative 'helper'
|
2
|
+
require_relative '../lib/nelumba/article.rb'
|
3
|
+
|
4
|
+
describe Nelumba::Article do
|
5
|
+
describe "#initialize" do
|
6
|
+
it "should store an author" do
|
7
|
+
author = mock('author')
|
8
|
+
Nelumba::Article.new(:author => author).author.must_equal author
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should store content" do
|
12
|
+
Nelumba::Article.new(:content => "txt").content.must_equal "txt"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should store the published date" do
|
16
|
+
time = mock('date')
|
17
|
+
Nelumba::Article.new(:published => time).published.must_equal time
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should store the updated date" do
|
21
|
+
time = mock('date')
|
22
|
+
Nelumba::Article.new(:updated => time).updated.must_equal time
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should store a display name" do
|
26
|
+
Nelumba::Article.new(:display_name => "url")
|
27
|
+
.display_name.must_equal "url"
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should store a summary" do
|
31
|
+
Nelumba::Article.new(:summary => "url").summary.must_equal "url"
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should store a url" do
|
35
|
+
Nelumba::Article.new(:url => "url").url.must_equal "url"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should store an id" do
|
39
|
+
Nelumba::Article.new(:uid => "id").uid.must_equal "id"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
describe "#to_hash" do
|
44
|
+
it "should contain the content" do
|
45
|
+
Nelumba::Article.new(:content => "Hello")
|
46
|
+
.to_hash[:content].must_equal "Hello"
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should contain the author" do
|
50
|
+
author = mock('Nelumba::Person')
|
51
|
+
Nelumba::Article.new(:author => author).to_hash[:author].must_equal author
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should contain the uid" do
|
55
|
+
Nelumba::Article.new(:uid => "Hello").to_hash[:uid].must_equal "Hello"
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should contain the url" do
|
59
|
+
Nelumba::Article.new(:url => "Hello").to_hash[:url].must_equal "Hello"
|
60
|
+
end
|
61
|
+
|
62
|
+
it "should contain the summary" do
|
63
|
+
Nelumba::Article.new(:summary=> "Hello")
|
64
|
+
.to_hash[:summary].must_equal "Hello"
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should contain the display name" do
|
68
|
+
Nelumba::Article.new(:display_name => "Hello")
|
69
|
+
.to_hash[:display_name].must_equal "Hello"
|
70
|
+
end
|
71
|
+
|
72
|
+
it "should contain the published date" do
|
73
|
+
date = mock('Time')
|
74
|
+
Nelumba::Article.new(:published => date).to_hash[:published].must_equal date
|
75
|
+
end
|
76
|
+
|
77
|
+
it "should contain the updated date" do
|
78
|
+
date = mock('Time')
|
79
|
+
Nelumba::Article.new(:updated => date).to_hash[:updated].must_equal date
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe "#to_json" do
|
84
|
+
before do
|
85
|
+
author = Nelumba::Person.new :display_name => "wilkie"
|
86
|
+
@note = Nelumba::Article.new :content => "Hello",
|
87
|
+
:author => author,
|
88
|
+
:uid => "id",
|
89
|
+
:url => "url",
|
90
|
+
:title => "title",
|
91
|
+
:summary => "foo",
|
92
|
+
:display_name => "meh",
|
93
|
+
:published => Time.now,
|
94
|
+
:updated => Time.now
|
95
|
+
|
96
|
+
@json = @note.to_json
|
97
|
+
@data = JSON.parse(@json)
|
98
|
+
end
|
99
|
+
|
100
|
+
it "should contain the embedded json for the author" do
|
101
|
+
@data["author"].must_equal JSON.parse(@note.author.to_json)
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should contain a 'article' objectType" do
|
105
|
+
@data["objectType"].must_equal "article"
|
106
|
+
end
|
107
|
+
|
108
|
+
it "should contain the id" do
|
109
|
+
@data["id"].must_equal @note.uid
|
110
|
+
end
|
111
|
+
|
112
|
+
it "should contain the content" do
|
113
|
+
@data["content"].must_equal @note.content
|
114
|
+
end
|
115
|
+
|
116
|
+
it "should contain the url" do
|
117
|
+
@data["url"].must_equal @note.url
|
118
|
+
end
|
119
|
+
|
120
|
+
it "should contain the summary" do
|
121
|
+
@data["summary"].must_equal @note.summary
|
122
|
+
end
|
123
|
+
|
124
|
+
it "should contain the display name" do
|
125
|
+
@data["displayName"].must_equal @note.display_name
|
126
|
+
end
|
127
|
+
|
128
|
+
it "should contain the published date as rfc3339" do
|
129
|
+
@data["published"].must_equal @note.published.to_date.rfc3339 + 'Z'
|
130
|
+
end
|
131
|
+
|
132
|
+
it "should contain the updated date as rfc3339" do
|
133
|
+
@data["updated"].must_equal @note.updated.to_date.rfc3339 + 'Z'
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
@@ -0,0 +1,455 @@
|
|
1
|
+
require_relative '../helper'
|
2
|
+
|
3
|
+
require_relative '../../lib/nelumba/atom/entry'
|
4
|
+
require_relative '../../lib/nelumba/atom/comment'
|
5
|
+
|
6
|
+
describe Nelumba::Atom::Comment do
|
7
|
+
before do
|
8
|
+
author = Nelumba::Person.new(:uri => "http://example.com/users/1",
|
9
|
+
:email => "user@example.com",
|
10
|
+
:name => "wilkie",
|
11
|
+
:uid => "1",
|
12
|
+
:nickname => "wilkie",
|
13
|
+
:extended_name => {:formatted => "Dave Wilkinson",
|
14
|
+
:family_name => "Wilkinson",
|
15
|
+
:given_name => "Dave",
|
16
|
+
:middle_name => "William",
|
17
|
+
:honorific_prefix => "Mr.",
|
18
|
+
:honorific_suffix => "II"},
|
19
|
+
:address => {:formatted => "123 Cherry Lane\nFoobar, PA, USA\n15206",
|
20
|
+
:street_address => "123 Cherry Lane",
|
21
|
+
:locality => "Foobar",
|
22
|
+
:region => "PA",
|
23
|
+
:postal_code => "15206",
|
24
|
+
:country => "USA"},
|
25
|
+
:organization => {:name => "Hackers of the Severed Hand",
|
26
|
+
:department => "Making Shit",
|
27
|
+
:title => "Founder",
|
28
|
+
:type => "open source",
|
29
|
+
:start_date => Date.today,
|
30
|
+
:end_date => Date.today,
|
31
|
+
:location => "everywhere",
|
32
|
+
:description => "I make ostatus work"},
|
33
|
+
:account => {:domain => "example.com",
|
34
|
+
:username => "wilkie",
|
35
|
+
:userid => "1"},
|
36
|
+
:gender => "androgynous",
|
37
|
+
:note => "cool dude",
|
38
|
+
:display_name => "Dave Wilkinson",
|
39
|
+
:preferred_username => "wilkie",
|
40
|
+
:updated => Time.now,
|
41
|
+
:published => Time.now,
|
42
|
+
:birthday => Date.today,
|
43
|
+
:anniversary => Date.today)
|
44
|
+
|
45
|
+
@master = Nelumba::Activity.new(
|
46
|
+
:verb => :post,
|
47
|
+
:actor => author,
|
48
|
+
:object => Nelumba::Comment.new(:content => "hello",
|
49
|
+
:author => author,
|
50
|
+
:display_name => "wilkie",
|
51
|
+
:in_reply_to => [],
|
52
|
+
:uid => "id",
|
53
|
+
:published => Time.now,
|
54
|
+
:updated => Time.now))
|
55
|
+
end
|
56
|
+
|
57
|
+
describe "<xml>" do
|
58
|
+
before do
|
59
|
+
@xml_str = Nelumba::Atom::Entry.from_canonical(@master).to_xml
|
60
|
+
@xml = XML::Parser.string(@xml_str).parse
|
61
|
+
end
|
62
|
+
|
63
|
+
describe "<entry>" do
|
64
|
+
before do
|
65
|
+
@entry = @xml.root
|
66
|
+
end
|
67
|
+
|
68
|
+
describe "<activity:object>" do
|
69
|
+
before do
|
70
|
+
@object = @entry.find_first('activity:object')
|
71
|
+
end
|
72
|
+
|
73
|
+
describe "<activity:object-type>" do
|
74
|
+
it "should identify this tag as a comment object" do
|
75
|
+
@object.find_first('activity:object-type').content
|
76
|
+
.must_equal "http://activitystrea.ms/schema/1.0/comment"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe "<content>" do
|
81
|
+
it "should contain the entry content" do
|
82
|
+
@object.find_first('xmlns:content', 'xmlns:http://www.w3.org/2005/Atom')
|
83
|
+
.content.must_equal @master.object.content
|
84
|
+
end
|
85
|
+
|
86
|
+
it "should have the corresponding type attribute of html" do
|
87
|
+
@object.find_first('xmlns:content', 'xmlns:http://www.w3.org/2005/Atom')
|
88
|
+
.attributes.get_attribute('type').value.must_equal "html"
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe "<updated>" do
|
93
|
+
it "should contain the entry updated date" do
|
94
|
+
time = @object.find_first('xmlns:updated',
|
95
|
+
'xmlns:http://www.w3.org/2005/Atom').content
|
96
|
+
DateTime.parse(time).to_s.must_equal @master.object.updated.to_datetime.to_s
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
describe "<published>" do
|
101
|
+
it "should contain the entry published date" do
|
102
|
+
time = @object.find_first('xmlns:published',
|
103
|
+
'xmlns:http://www.w3.org/2005/Atom').content
|
104
|
+
DateTime.parse(time).to_s.must_equal @master.object.published.to_datetime.to_s
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
describe "<id>" do
|
109
|
+
it "should contain the entry id" do
|
110
|
+
@object.find_first('xmlns:id', 'xmlns:http://www.w3.org/2005/Atom')
|
111
|
+
.content.must_equal @master.object.uid
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
describe "<displayName>" do
|
116
|
+
it "should contain the entry displayName" do
|
117
|
+
@object.find_first('xmlns:displayName', 'xmlns:http://www.w3.org/2005/Atom')
|
118
|
+
.content.must_equal @master.object.display_name
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
describe "<author>" do
|
123
|
+
before do
|
124
|
+
@author = @object.find_first('xmlns:author', 'xmlns:http://www.w3.org/2005/Atom')
|
125
|
+
end
|
126
|
+
|
127
|
+
describe "<activity:object-type>" do
|
128
|
+
it "should identify this tag as a person object" do
|
129
|
+
@author.find_first('activity:object-type').content
|
130
|
+
.must_equal "http://activitystrea.ms/schema/1.0/person"
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
describe "<email>" do
|
135
|
+
it "should list the author's email" do
|
136
|
+
@author.find_first('xmlns:email',
|
137
|
+
'xmlns:http://www.w3.org/2005/Atom').content.must_equal @master.object.author.email
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
describe "<uri>" do
|
142
|
+
it "should list the author's uri" do
|
143
|
+
@author.find_first('xmlns:uri',
|
144
|
+
'xmlns:http://www.w3.org/2005/Atom').content.must_equal @master.object.author.uri
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
describe "<name>" do
|
149
|
+
it "should list the author's name" do
|
150
|
+
@author.find_first('xmlns:name',
|
151
|
+
'xmlns:http://www.w3.org/2005/Atom').content.must_equal @master.object.author.name
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
155
|
+
describe "<poco:id>" do
|
156
|
+
it "should list the author's portable contact id" do
|
157
|
+
@author.find_first('poco:id',
|
158
|
+
'http://portablecontacts.net/spec/1.0').content.must_equal @master.object.author.uid
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
describe "<poco:name>" do
|
163
|
+
before do
|
164
|
+
@poco_name = @author.find_first('poco:name',
|
165
|
+
'http://portablecontacts.net/spec/1.0')
|
166
|
+
end
|
167
|
+
|
168
|
+
describe "<formatted>" do
|
169
|
+
it "should list the author's portable contact formatted name" do
|
170
|
+
@poco_name.find_first('xmlns:formatted',
|
171
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
172
|
+
.content.must_equal @master.object.author.extended_name[:formatted]
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
describe "<familyName>" do
|
177
|
+
it "should list the author's portable contact family name" do
|
178
|
+
@poco_name.find_first('xmlns:familyName',
|
179
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
180
|
+
.content.must_equal @master.object.author.extended_name[:family_name]
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
describe "<givenName>" do
|
185
|
+
it "should list the author's portable contact given name" do
|
186
|
+
@poco_name.find_first('xmlns:givenName',
|
187
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
188
|
+
.content.must_equal @master.object.author.extended_name[:given_name]
|
189
|
+
end
|
190
|
+
end
|
191
|
+
|
192
|
+
describe "<middleName>" do
|
193
|
+
it "should list the author's portable contact middle name" do
|
194
|
+
@poco_name.find_first('xmlns:middleName',
|
195
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
196
|
+
.content.must_equal @master.object.author.extended_name[:middle_name]
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
describe "<honorificPrefix>" do
|
201
|
+
it "should list the author's portable contact honorific prefix" do
|
202
|
+
@poco_name.find_first('xmlns:honorificPrefix',
|
203
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
204
|
+
.content.must_equal @master.object.author.extended_name[:honorific_prefix]
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
describe "<honorificSuffix>" do
|
209
|
+
it "should list the author's portable contact honorific suffix" do
|
210
|
+
@poco_name.find_first('xmlns:honorificSuffix',
|
211
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
212
|
+
.content.must_equal @master.object.author.extended_name[:honorific_suffix]
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
describe "<poco:organization>" do
|
218
|
+
before do
|
219
|
+
@poco_org = @author.find_first('poco:organization',
|
220
|
+
'http://portablecontacts.net/spec/1.0')
|
221
|
+
end
|
222
|
+
|
223
|
+
describe "<name>" do
|
224
|
+
it "should list the author's portable contact organization name" do
|
225
|
+
@poco_org.find_first('xmlns:name',
|
226
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
227
|
+
.content.must_equal @master.object.author.organization[:name]
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
describe "<department>" do
|
232
|
+
it "should list the author's portable contact organization department" do
|
233
|
+
@poco_org.find_first('xmlns:department',
|
234
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
235
|
+
.content.must_equal @master.object.author.organization[:department]
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
describe "<title>" do
|
240
|
+
it "should list the author's portable contact organization title" do
|
241
|
+
@poco_org.find_first('xmlns:title',
|
242
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
243
|
+
.content.must_equal @master.object.author.organization[:title]
|
244
|
+
end
|
245
|
+
end
|
246
|
+
|
247
|
+
describe "<type>" do
|
248
|
+
it "should list the author's portable contact organization type" do
|
249
|
+
@poco_org.find_first('xmlns:type',
|
250
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
251
|
+
.content.must_equal @master.object.author.organization[:type]
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
describe "<startDate>" do
|
256
|
+
it "should list the author's portable contact organization startDate" do
|
257
|
+
time = @poco_org.find_first('xmlns:startDate',
|
258
|
+
'xmlns:http://www.w3.org/2005/Atom').content
|
259
|
+
DateTime::parse(time).to_s
|
260
|
+
.must_equal @master.object.author.organization[:start_date].to_datetime.to_s
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
describe "<endDate>" do
|
265
|
+
it "should list the author's portable contact organization endDate" do
|
266
|
+
time = @poco_org.find_first('xmlns:endDate',
|
267
|
+
'xmlns:http://www.w3.org/2005/Atom').content
|
268
|
+
DateTime::parse(time).to_s
|
269
|
+
.must_equal @master.object.author.organization[:end_date].to_datetime.to_s
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
describe "<location>" do
|
274
|
+
it "should list the author's portable contact organization location" do
|
275
|
+
@poco_org.find_first('xmlns:location',
|
276
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
277
|
+
.content.must_equal @master.object.author.organization[:location]
|
278
|
+
end
|
279
|
+
end
|
280
|
+
|
281
|
+
describe "<description>" do
|
282
|
+
it "should list the author's portable contact organization description" do
|
283
|
+
@poco_org.find_first('xmlns:description',
|
284
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
285
|
+
.content.must_equal @master.object.author.organization[:description]
|
286
|
+
end
|
287
|
+
end
|
288
|
+
end
|
289
|
+
|
290
|
+
describe "<poco:address>" do
|
291
|
+
before do
|
292
|
+
@poco_address = @author.find_first('poco:address',
|
293
|
+
'http://portablecontacts.net/spec/1.0')
|
294
|
+
end
|
295
|
+
|
296
|
+
describe "<formatted>" do
|
297
|
+
it "should list the author's portable contact formatted address" do
|
298
|
+
@poco_address.find_first('xmlns:formatted',
|
299
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
300
|
+
.content.must_equal @master.object.author.address[:formatted]
|
301
|
+
end
|
302
|
+
end
|
303
|
+
|
304
|
+
describe "<streetAddress>" do
|
305
|
+
it "should list the author's portable contact address streetAddress" do
|
306
|
+
@poco_address.find_first('xmlns:streetAddress',
|
307
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
308
|
+
.content.must_equal @master.object.author.address[:street_address]
|
309
|
+
end
|
310
|
+
end
|
311
|
+
|
312
|
+
describe "<locality>" do
|
313
|
+
it "should list the author's portable contact address locality" do
|
314
|
+
@poco_address.find_first('xmlns:locality',
|
315
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
316
|
+
.content.must_equal @master.object.author.address[:locality]
|
317
|
+
end
|
318
|
+
end
|
319
|
+
|
320
|
+
describe "<region>" do
|
321
|
+
it "should list the author's portable contact address region" do
|
322
|
+
@poco_address.find_first('xmlns:region',
|
323
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
324
|
+
.content.must_equal @master.object.author.address[:region]
|
325
|
+
end
|
326
|
+
end
|
327
|
+
|
328
|
+
describe "<postalCode>" do
|
329
|
+
it "should list the author's portable contact address postalCode" do
|
330
|
+
@poco_address.find_first('xmlns:postalCode',
|
331
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
332
|
+
.content.must_equal @master.object.author.address[:postal_code]
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
describe "<country>" do
|
337
|
+
it "should list the author's portable contact address country" do
|
338
|
+
@poco_address.find_first('xmlns:country',
|
339
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
340
|
+
.content.must_equal @master.object.author.address[:country]
|
341
|
+
end
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
describe "<poco:account>" do
|
346
|
+
before do
|
347
|
+
@poco_account = @author.find_first('poco:account',
|
348
|
+
'http://portablecontacts.net/spec/1.0')
|
349
|
+
end
|
350
|
+
|
351
|
+
describe "<domain>" do
|
352
|
+
it "should list the author's portable contact account domain" do
|
353
|
+
@poco_account.find_first('xmlns:domain',
|
354
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
355
|
+
.content.must_equal @master.object.author.account[:domain]
|
356
|
+
end
|
357
|
+
end
|
358
|
+
|
359
|
+
describe "<username>" do
|
360
|
+
it "should list the author's portable contact account username" do
|
361
|
+
@poco_account.find_first('xmlns:username',
|
362
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
363
|
+
.content.must_equal @master.object.author.account[:username]
|
364
|
+
end
|
365
|
+
end
|
366
|
+
|
367
|
+
describe "<userid>" do
|
368
|
+
it "should list the author's portable contact account userid" do
|
369
|
+
@poco_account.find_first('xmlns:userid',
|
370
|
+
'xmlns:http://www.w3.org/2005/Atom')
|
371
|
+
.content.must_equal @master.object.author.account[:userid]
|
372
|
+
end
|
373
|
+
end
|
374
|
+
end
|
375
|
+
|
376
|
+
describe "<poco:displayName>" do
|
377
|
+
it "should list the author's portable contact display name" do
|
378
|
+
@author.find_first('poco:displayName',
|
379
|
+
'http://portablecontacts.net/spec/1.0')
|
380
|
+
.content.must_equal @master.object.author.display_name
|
381
|
+
end
|
382
|
+
end
|
383
|
+
|
384
|
+
describe "<poco:nickname>" do
|
385
|
+
it "should list the author's portable contact nickname" do
|
386
|
+
@author.find_first('poco:nickname',
|
387
|
+
'http://portablecontacts.net/spec/1.0')
|
388
|
+
.content.must_equal @master.object.author.nickname
|
389
|
+
end
|
390
|
+
end
|
391
|
+
|
392
|
+
describe "<poco:gender>" do
|
393
|
+
it "should list the author's portable contact gender" do
|
394
|
+
@author.find_first('poco:gender',
|
395
|
+
'http://portablecontacts.net/spec/1.0')
|
396
|
+
.content.must_equal @master.object.author.gender
|
397
|
+
end
|
398
|
+
end
|
399
|
+
|
400
|
+
describe "<poco:note>" do
|
401
|
+
it "should list the author's portable contact note" do
|
402
|
+
@author.find_first('poco:note',
|
403
|
+
'http://portablecontacts.net/spec/1.0')
|
404
|
+
.content.must_equal @master.object.author.note
|
405
|
+
end
|
406
|
+
end
|
407
|
+
|
408
|
+
describe "<poco:preferredUsername>" do
|
409
|
+
it "should list the author's portable contact preferred username" do
|
410
|
+
@author.find_first('poco:preferredUsername',
|
411
|
+
'http://portablecontacts.net/spec/1.0')
|
412
|
+
.content.must_equal @master.object.author.preferred_username
|
413
|
+
end
|
414
|
+
end
|
415
|
+
|
416
|
+
describe "<poco:birthday>" do
|
417
|
+
it "should list the author's portable contact birthday" do
|
418
|
+
time = @author.find_first('poco:birthday',
|
419
|
+
'http://portablecontacts.net/spec/1.0').content
|
420
|
+
DateTime::parse(time).to_s.must_equal @master.object.author
|
421
|
+
.birthday.to_datetime.to_s
|
422
|
+
end
|
423
|
+
end
|
424
|
+
|
425
|
+
describe "<poco:anniversary>" do
|
426
|
+
it "should list the author's portable contact anniversary" do
|
427
|
+
time = @author.find_first('poco:anniversary',
|
428
|
+
'http://portablecontacts.net/spec/1.0').content
|
429
|
+
DateTime::parse(time).to_s.must_equal @master.object.author
|
430
|
+
.anniversary.to_datetime.to_s
|
431
|
+
end
|
432
|
+
end
|
433
|
+
|
434
|
+
describe "<poco:published>" do
|
435
|
+
it "should list the author's portable contact published date" do
|
436
|
+
time = @author.find_first('poco:published',
|
437
|
+
'http://portablecontacts.net/spec/1.0').content
|
438
|
+
DateTime::parse(time).to_s.must_equal @master.object.author
|
439
|
+
.published.to_datetime.to_s
|
440
|
+
end
|
441
|
+
end
|
442
|
+
|
443
|
+
describe "<poco:updated>" do
|
444
|
+
it "should list the author's portable contact updated date" do
|
445
|
+
time = @author.find_first('poco:updated',
|
446
|
+
'http://portablecontacts.net/spec/1.0').content
|
447
|
+
DateTime::parse(time).to_s.must_equal @master.object.author
|
448
|
+
.updated.to_datetime.to_s
|
449
|
+
end
|
450
|
+
end
|
451
|
+
end
|
452
|
+
end
|
453
|
+
end
|
454
|
+
end
|
455
|
+
end
|