hentry_consumer 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,29 +3,25 @@ require 'hentry_consumer'
3
3
  describe HentryConsumer::HFeed do
4
4
  let(:feed) { HentryConsumer.parse(File.open("spec/support/example.html")) }
5
5
 
6
- describe "to json" do
6
+ describe "#to_json" do
7
7
  let(:json) { JSON.parse(feed.to_json) }
8
-
9
8
  it { json["items"].first["type"].should include 'h-feed'}
10
9
  it { json["items"].first["properties"]["entries"].should be_an_instance_of Array }
11
10
  it { json["items"].first["properties"]["entries"].first["items"].should be_an_instance_of Array }
12
11
  it { json["items"].first["properties"]["entries"].first["items"].first["type"].should include "h-entry" }
13
-
14
12
  end
15
13
 
16
- describe "to_s" do
14
+ describe "#to_s" do
17
15
  let(:string) { feed.to_s }
18
16
  it "should have nicely formatted content" do
19
17
  string.should match feed.to_html
20
18
  end
21
19
  end
22
20
 
23
- describe "html" do
21
+ describe "#to_html" do
24
22
  let(:html) { feed.to_html }
25
-
26
23
  it "should match the example html" do
27
24
  html.gsub(/\\n|\s/, '').should eq File.open("spec/support/example.html").read.gsub(/\\n|\s/, '')
28
25
  end
29
26
  end
30
-
31
- end
27
+ end
@@ -0,0 +1,620 @@
1
+ <html><head>
2
+ <title>Customers</title>
3
+ <meta charset="utf8">
4
+ </head>
5
+ <body>
6
+ <div class="container-fluid">
7
+
8
+ <div class="navbar">
9
+ <div class="navbar-inner">
10
+ <div class="container">
11
+
12
+ <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
13
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
14
+ <span class="icon-bar"></span>
15
+ <span class="icon-bar"></span>
16
+ <span class="icon-bar"></span>
17
+ </a>
18
+
19
+ <!-- Be sure to leave the brand out there if you want it shown -->
20
+ <a class="brand" href="/">G5 Hub</a>
21
+
22
+ <!-- Everything you want hidden at 940px or less, place within here -->
23
+ <div class="nav-collapse">
24
+ <ul class="nav">
25
+ <li><a href="/customers">Customers</a></li>
26
+ <li><a href="/locations">Locations</a></li>
27
+ <li><a href="/features">Features</a></li>
28
+ <li><a href="/logout">Logout</a></li>
29
+ </ul>
30
+ </div>
31
+
32
+ </div>
33
+ </div>
34
+ </div>
35
+
36
+
37
+ <div class="row page-header">
38
+ <h1 class="span10">Customers</h1>
39
+ <span class="span2"><a href="/customers/new" class="btn btn-success">New Customer</a></span>
40
+ </div>
41
+
42
+
43
+ <section class="h-feed">
44
+ <dl class="h-entry well">
45
+ <dt>Name</dt>
46
+ <dd>
47
+ <span class="p-name">Wabi Sabi Town</span>
48
+ </dd>
49
+ <dt>Bookmark/UID</dt>
50
+ <dd>
51
+ <a href="http://localhost:3000/customers/3" rel="bookmark" class="u-url u-uid">
52
+ http://localhost:3000/customers/3
53
+ </a>
54
+ </dd>
55
+ <dt>Summary</dt>
56
+ <dd>
57
+ <span class="p-summary">Signed up with 2 locations</span>
58
+ </dd>
59
+ <dt>Published</dt>
60
+ <dd>
61
+ <time datetime="2012-10-10T19:11:17Z" class="dt-published">
62
+ 07:11pm on October 10, 2012
63
+ </time>
64
+ </dd>
65
+ <dt>Category</dt>
66
+ <dd>
67
+ <a class="p-category" href="#" rel="tag">
68
+ Some Category
69
+ </a>
70
+ </dd>
71
+ <dt>Author</dt>
72
+ <dd>
73
+ <dl class="p-author h-card dl-horizontal">
74
+ <dt>UID</dt>
75
+ <dd>
76
+ <a class="u-url u-uid" href="http://localhost:3000/admins/1">
77
+ http://localhost:3000/admins/1
78
+ </a>
79
+ </dd>
80
+ <dt>Name</dt>
81
+ <dd>
82
+ <span class="p-name">Jessica</span>
83
+ </dd>
84
+ <dt>Email</dt>
85
+ <dd>
86
+ <a class="u-email" href="mailto:jessica.suttles@getg5.com">
87
+ jessica.suttles@getg5.com
88
+ </a>
89
+ </dd>
90
+ </dl>
91
+ </dd>
92
+ <dt>Content</dt>
93
+ <dd>
94
+ <dl class="e-content">
95
+ <dt>Customer</dt>
96
+ <dd class="h-card">
97
+ <dl class="dl-horizontal">
98
+ <dt>UID</dt>
99
+ <dd>
100
+ <a class="u-url u-uid" href="http://localhost:3000/customers/3">
101
+ http://localhost:3000/customers/3
102
+ </a>
103
+ </dd>
104
+ <dt>Name</dt>
105
+ <dd>
106
+ <span class="p-name">Wabi Sabi Town</span>
107
+ </dd>
108
+ <dt>Actions</dt>
109
+ <dd>
110
+ <dl class="dl-horizontal">
111
+ <dt>All</dt>
112
+ <dd>
113
+ <a href="http://localhost:3000/customers">http://localhost:3000/customers</a>
114
+ </dd>
115
+ <dt>Edit</dt>
116
+ <dd>
117
+ <a href="http://localhost:3000/customers/3/edit">http://localhost:3000/customers/3/edit</a>
118
+ </dd>
119
+ <dt>Destroy</dt>
120
+ <dd>
121
+ <a href="/customers/3" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/customers/3</a>
122
+ </dd>
123
+ </dl>
124
+ </dd>
125
+ </dl>
126
+ </dd>
127
+ <dt>Locations</dt>
128
+ <dd>
129
+ <dl class="h-card dl-horizontal">
130
+ <dt>UID</dt>
131
+ <dd>
132
+ <a class="u-url u-uid" href="http://localhost:3000/locations/7">
133
+ http://localhost:3000/locations/7
134
+ </a>
135
+ </dd>
136
+ <dt>Name</dt>
137
+ <dd>
138
+ <span class="p-name">Corporate</span>
139
+ </dd>
140
+ <dt>Corporate</dt>
141
+ <dd>
142
+ <span>true</span>
143
+ </dd>
144
+ <dt>Actions</dt>
145
+ <dd>
146
+ <dl class="dl-horizontal">
147
+ <dt>All</dt>
148
+ <dd>
149
+ <a href="http://localhost:3000/locations">http://localhost:3000/locations</a>
150
+ </dd>
151
+ <dt>Edit</dt>
152
+ <dd>
153
+ <a href="http://localhost:3000/locations/7/edit">http://localhost:3000/locations/7/edit</a>
154
+ </dd>
155
+ <dt>Destroy</dt>
156
+ <dd>
157
+ <a href="/locations/7" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/locations/7</a>
158
+ </dd>
159
+ </dl>
160
+ </dd>
161
+ </dl>
162
+
163
+ <dl class="h-card dl-horizontal">
164
+ <dt>UID</dt>
165
+ <dd>
166
+ <a class="u-url u-uid" href="http://localhost:3000/locations/8">
167
+ http://localhost:3000/locations/8
168
+ </a>
169
+ </dd>
170
+ <dt>Name</dt>
171
+ <dd>
172
+ <span class="p-name">Not Corporate</span>
173
+ </dd>
174
+ <dt>Corporate</dt>
175
+ <dd>
176
+ <span>false</span>
177
+ </dd>
178
+ <dt>Actions</dt>
179
+ <dd>
180
+ <dl class="dl-horizontal">
181
+ <dt>All</dt>
182
+ <dd>
183
+ <a href="http://localhost:3000/locations">http://localhost:3000/locations</a>
184
+ </dd>
185
+ <dt>Edit</dt>
186
+ <dd>
187
+ <a href="http://localhost:3000/locations/8/edit">http://localhost:3000/locations/8/edit</a>
188
+ </dd>
189
+ <dt>Destroy</dt>
190
+ <dd>
191
+ <a href="/locations/8" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/locations/8</a>
192
+ </dd>
193
+ </dl>
194
+ </dd>
195
+ </dl>
196
+
197
+ </dd>
198
+ <dt>Features</dt>
199
+ <dd>
200
+ <dl class="h-product dl-horizontal">
201
+ <dt>UID</dt>
202
+ <dd>
203
+ <a class="u-url u-uid" href="http://localhost:3000/features/1">
204
+ http://localhost:3000/features/1
205
+ </a>
206
+ </dd>
207
+ <dt>Name</dt>
208
+ <dd>
209
+ <span class="p-name">Insight</span>
210
+ </dd>
211
+ <dt>Actions</dt>
212
+ <dd>
213
+ <dl class="dl-horizontal">
214
+ <dt>All</dt>
215
+ <dd>
216
+ <a href="http://localhost:3000/features">http://localhost:3000/features</a>
217
+ </dd>
218
+ <dt>Edit</dt>
219
+ <dd>
220
+ <a href="http://localhost:3000/features/1/edit">http://localhost:3000/features/1/edit</a>
221
+ </dd>
222
+ <dt>Destroy</dt>
223
+ <dd>
224
+ <a href="/features/1" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/features/1</a>
225
+ </dd>
226
+ </dl>
227
+ </dd>
228
+ </dl>
229
+
230
+ <dl class="h-product dl-horizontal">
231
+ <dt>UID</dt>
232
+ <dd>
233
+ <a class="u-url u-uid" href="http://localhost:3000/features/2">
234
+ http://localhost:3000/features/2
235
+ </a>
236
+ </dd>
237
+ <dt>Name</dt>
238
+ <dd>
239
+ <span class="p-name">Content</span>
240
+ </dd>
241
+ <dt>Actions</dt>
242
+ <dd>
243
+ <dl class="dl-horizontal">
244
+ <dt>All</dt>
245
+ <dd>
246
+ <a href="http://localhost:3000/features">http://localhost:3000/features</a>
247
+ </dd>
248
+ <dt>Edit</dt>
249
+ <dd>
250
+ <a href="http://localhost:3000/features/2/edit">http://localhost:3000/features/2/edit</a>
251
+ </dd>
252
+ <dt>Destroy</dt>
253
+ <dd>
254
+ <a href="/features/2" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/features/2</a>
255
+ </dd>
256
+ </dl>
257
+ </dd>
258
+ </dl>
259
+
260
+ <dl class="h-product dl-horizontal">
261
+ <dt>UID</dt>
262
+ <dd>
263
+ <a class="u-url u-uid" href="http://localhost:3000/features/3">
264
+ http://localhost:3000/features/3
265
+ </a>
266
+ </dd>
267
+ <dt>Name</dt>
268
+ <dd>
269
+ <span class="p-name">Reputation</span>
270
+ </dd>
271
+ <dt>Actions</dt>
272
+ <dd>
273
+ <dl class="dl-horizontal">
274
+ <dt>All</dt>
275
+ <dd>
276
+ <a href="http://localhost:3000/features">http://localhost:3000/features</a>
277
+ </dd>
278
+ <dt>Edit</dt>
279
+ <dd>
280
+ <a href="http://localhost:3000/features/3/edit">http://localhost:3000/features/3/edit</a>
281
+ </dd>
282
+ <dt>Destroy</dt>
283
+ <dd>
284
+ <a href="/features/3" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/features/3</a>
285
+ </dd>
286
+ </dl>
287
+ </dd>
288
+ </dl>
289
+
290
+ </dd>
291
+ </dl>
292
+ </dd>
293
+ </dl>
294
+
295
+ <dl class="h-entry well">
296
+ <dt>Name</dt>
297
+ <dd>
298
+ <span class="p-name">Senior Cat Living</span>
299
+ </dd>
300
+ <dt>Bookmark/UID</dt>
301
+ <dd>
302
+ <a href="http://localhost:3000/customers/1" rel="bookmark" class="u-url u-uid">
303
+ http://localhost:3000/customers/1
304
+ </a>
305
+ </dd>
306
+ <dt>Summary</dt>
307
+ <dd>
308
+ <span class="p-summary">Signed up with 4 locations</span>
309
+ </dd>
310
+ <dt>Published</dt>
311
+ <dd>
312
+ <time datetime="2012-10-03T22:22:16Z" class="dt-published">
313
+ 10:22pm on October 3, 2012
314
+ </time>
315
+ </dd>
316
+ <dt>Category</dt>
317
+ <dd>
318
+ <a class="p-category" href="#" rel="tag">
319
+ Some Category
320
+ </a>
321
+ </dd>
322
+ <dt>Author</dt>
323
+ <dd>
324
+ <dl class="p-author h-card dl-horizontal">
325
+ <dt>UID</dt>
326
+ <dd>
327
+ <a class="u-url u-uid" href="http://localhost:3000/admins/1">
328
+ http://localhost:3000/admins/1
329
+ </a>
330
+ </dd>
331
+ <dt>Name</dt>
332
+ <dd>
333
+ <span class="p-name">Jessica</span>
334
+ </dd>
335
+ <dt>Email</dt>
336
+ <dd>
337
+ <a class="u-email" href="mailto:jessica.suttles@getg5.com">
338
+ jessica.suttles@getg5.com
339
+ </a>
340
+ </dd>
341
+ </dl>
342
+ </dd>
343
+ <dt>Content</dt>
344
+ <dd>
345
+ <dl class="e-content">
346
+ <dt>Customer</dt>
347
+ <dd class="h-card">
348
+ <dl class="dl-horizontal">
349
+ <dt>UID</dt>
350
+ <dd>
351
+ <a class="u-url u-uid" href="http://localhost:3000/customers/1">
352
+ http://localhost:3000/customers/1
353
+ </a>
354
+ </dd>
355
+ <dt>Name</dt>
356
+ <dd>
357
+ <span class="p-name">Senior Cat Living</span>
358
+ </dd>
359
+ <dt>Actions</dt>
360
+ <dd>
361
+ <dl class="dl-horizontal">
362
+ <dt>All</dt>
363
+ <dd>
364
+ <a href="http://localhost:3000/customers">http://localhost:3000/customers</a>
365
+ </dd>
366
+ <dt>Edit</dt>
367
+ <dd>
368
+ <a href="http://localhost:3000/customers/1/edit">http://localhost:3000/customers/1/edit</a>
369
+ </dd>
370
+ <dt>Destroy</dt>
371
+ <dd>
372
+ <a href="/customers/1" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/customers/1</a>
373
+ </dd>
374
+ </dl>
375
+ </dd>
376
+ </dl>
377
+ </dd>
378
+ <dt>Locations</dt>
379
+ <dd>
380
+ <dl class="h-card dl-horizontal">
381
+ <dt>UID</dt>
382
+ <dd>
383
+ <a class="u-url u-uid" href="http://localhost:3000/locations/1">
384
+ http://localhost:3000/locations/1
385
+ </a>
386
+ </dd>
387
+ <dt>Name</dt>
388
+ <dd>
389
+ <span class="p-name">Senior Cat Living Corporate</span>
390
+ </dd>
391
+ <dt>Corporate</dt>
392
+ <dd>
393
+ <span>true</span>
394
+ </dd>
395
+ <dt>Actions</dt>
396
+ <dd>
397
+ <dl class="dl-horizontal">
398
+ <dt>All</dt>
399
+ <dd>
400
+ <a href="http://localhost:3000/locations">http://localhost:3000/locations</a>
401
+ </dd>
402
+ <dt>Edit</dt>
403
+ <dd>
404
+ <a href="http://localhost:3000/locations/1/edit">http://localhost:3000/locations/1/edit</a>
405
+ </dd>
406
+ <dt>Destroy</dt>
407
+ <dd>
408
+ <a href="/locations/1" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/locations/1</a>
409
+ </dd>
410
+ </dl>
411
+ </dd>
412
+ </dl>
413
+
414
+ <dl class="h-card dl-horizontal">
415
+ <dt>UID</dt>
416
+ <dd>
417
+ <a class="u-url u-uid" href="http://localhost:3000/locations/2">
418
+ http://localhost:3000/locations/2
419
+ </a>
420
+ </dd>
421
+ <dt>Name</dt>
422
+ <dd>
423
+ <span class="p-name">Senior Cat Living Location 1</span>
424
+ </dd>
425
+ <dt>Corporate</dt>
426
+ <dd>
427
+ <span>false</span>
428
+ </dd>
429
+ <dt>Actions</dt>
430
+ <dd>
431
+ <dl class="dl-horizontal">
432
+ <dt>All</dt>
433
+ <dd>
434
+ <a href="http://localhost:3000/locations">http://localhost:3000/locations</a>
435
+ </dd>
436
+ <dt>Edit</dt>
437
+ <dd>
438
+ <a href="http://localhost:3000/locations/2/edit">http://localhost:3000/locations/2/edit</a>
439
+ </dd>
440
+ <dt>Destroy</dt>
441
+ <dd>
442
+ <a href="/locations/2" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/locations/2</a>
443
+ </dd>
444
+ </dl>
445
+ </dd>
446
+ </dl>
447
+
448
+ <dl class="h-card dl-horizontal">
449
+ <dt>UID</dt>
450
+ <dd>
451
+ <a class="u-url u-uid" href="http://localhost:3000/locations/3">
452
+ http://localhost:3000/locations/3
453
+ </a>
454
+ </dd>
455
+ <dt>Name</dt>
456
+ <dd>
457
+ <span class="p-name">Senior Cat Living Location 2</span>
458
+ </dd>
459
+ <dt>Corporate</dt>
460
+ <dd>
461
+ <span>false</span>
462
+ </dd>
463
+ <dt>Actions</dt>
464
+ <dd>
465
+ <dl class="dl-horizontal">
466
+ <dt>All</dt>
467
+ <dd>
468
+ <a href="http://localhost:3000/locations">http://localhost:3000/locations</a>
469
+ </dd>
470
+ <dt>Edit</dt>
471
+ <dd>
472
+ <a href="http://localhost:3000/locations/3/edit">http://localhost:3000/locations/3/edit</a>
473
+ </dd>
474
+ <dt>Destroy</dt>
475
+ <dd>
476
+ <a href="/locations/3" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/locations/3</a>
477
+ </dd>
478
+ </dl>
479
+ </dd>
480
+ </dl>
481
+
482
+ <dl class="h-card dl-horizontal">
483
+ <dt>UID</dt>
484
+ <dd>
485
+ <a class="u-url u-uid" href="http://localhost:3000/locations/4">
486
+ http://localhost:3000/locations/4
487
+ </a>
488
+ </dd>
489
+ <dt>Name</dt>
490
+ <dd>
491
+ <span class="p-name">Senior Cat Living Location 3</span>
492
+ </dd>
493
+ <dt>Corporate</dt>
494
+ <dd>
495
+ <span>false</span>
496
+ </dd>
497
+ <dt>Actions</dt>
498
+ <dd>
499
+ <dl class="dl-horizontal">
500
+ <dt>All</dt>
501
+ <dd>
502
+ <a href="http://localhost:3000/locations">http://localhost:3000/locations</a>
503
+ </dd>
504
+ <dt>Edit</dt>
505
+ <dd>
506
+ <a href="http://localhost:3000/locations/4/edit">http://localhost:3000/locations/4/edit</a>
507
+ </dd>
508
+ <dt>Destroy</dt>
509
+ <dd>
510
+ <a href="/locations/4" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/locations/4</a>
511
+ </dd>
512
+ </dl>
513
+ </dd>
514
+ </dl>
515
+
516
+ </dd>
517
+ <dt>Features</dt>
518
+ <dd>
519
+ <dl class="h-product dl-horizontal">
520
+ <dt>UID</dt>
521
+ <dd>
522
+ <a class="u-url u-uid" href="http://localhost:3000/features/1">
523
+ http://localhost:3000/features/1
524
+ </a>
525
+ </dd>
526
+ <dt>Name</dt>
527
+ <dd>
528
+ <span class="p-name">Insight</span>
529
+ </dd>
530
+ <dt>Actions</dt>
531
+ <dd>
532
+ <dl class="dl-horizontal">
533
+ <dt>All</dt>
534
+ <dd>
535
+ <a href="http://localhost:3000/features">http://localhost:3000/features</a>
536
+ </dd>
537
+ <dt>Edit</dt>
538
+ <dd>
539
+ <a href="http://localhost:3000/features/1/edit">http://localhost:3000/features/1/edit</a>
540
+ </dd>
541
+ <dt>Destroy</dt>
542
+ <dd>
543
+ <a href="/features/1" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/features/1</a>
544
+ </dd>
545
+ </dl>
546
+ </dd>
547
+ </dl>
548
+
549
+ <dl class="h-product dl-horizontal">
550
+ <dt>UID</dt>
551
+ <dd>
552
+ <a class="u-url u-uid" href="http://localhost:3000/features/2">
553
+ http://localhost:3000/features/2
554
+ </a>
555
+ </dd>
556
+ <dt>Name</dt>
557
+ <dd>
558
+ <span class="p-name">Content</span>
559
+ </dd>
560
+ <dt>Actions</dt>
561
+ <dd>
562
+ <dl class="dl-horizontal">
563
+ <dt>All</dt>
564
+ <dd>
565
+ <a href="http://localhost:3000/features">http://localhost:3000/features</a>
566
+ </dd>
567
+ <dt>Edit</dt>
568
+ <dd>
569
+ <a href="http://localhost:3000/features/2/edit">http://localhost:3000/features/2/edit</a>
570
+ </dd>
571
+ <dt>Destroy</dt>
572
+ <dd>
573
+ <a href="/features/2" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/features/2</a>
574
+ </dd>
575
+ </dl>
576
+ </dd>
577
+ </dl>
578
+
579
+ <dl class="h-product dl-horizontal">
580
+ <dt>UID</dt>
581
+ <dd>
582
+ <a class="u-url u-uid" href="http://localhost:3000/features/4">
583
+ http://localhost:3000/features/4
584
+ </a>
585
+ </dd>
586
+ <dt>Name</dt>
587
+ <dd>
588
+ <span class="p-name">Support</span>
589
+ </dd>
590
+ <dt>Actions</dt>
591
+ <dd>
592
+ <dl class="dl-horizontal">
593
+ <dt>All</dt>
594
+ <dd>
595
+ <a href="http://localhost:3000/features">http://localhost:3000/features</a>
596
+ </dd>
597
+ <dt>Edit</dt>
598
+ <dd>
599
+ <a href="http://localhost:3000/features/4/edit">http://localhost:3000/features/4/edit</a>
600
+ </dd>
601
+ <dt>Destroy</dt>
602
+ <dd>
603
+ <a href="/features/4" data-confirm="Are you sure?" data-method="delete" rel="nofollow">http://localhost:3000/features/4</a>
604
+ </dd>
605
+ </dl>
606
+ </dd>
607
+ </dl>
608
+
609
+ </dd>
610
+ </dl>
611
+ </dd>
612
+ </dl>
613
+
614
+ </section>
615
+
616
+
617
+ </div>
618
+
619
+
620
+ </body></html>