onebox 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +7 -452
  4. data/Gemfile +1 -1
  5. data/README.md +23 -45
  6. data/lib/onebox.rb +21 -13
  7. data/lib/onebox/engine.rb +53 -43
  8. data/lib/onebox/engine/amazon_onebox.rb +34 -7
  9. data/lib/onebox/engine/classic_google_maps_onebox.rb +37 -0
  10. data/lib/onebox/engine/github_blob_onebox.rb +27 -7
  11. data/lib/onebox/engine/github_commit_onebox.rb +8 -15
  12. data/lib/onebox/engine/github_gist_onebox.rb +10 -10
  13. data/lib/onebox/engine/github_pullrequest_onebox.rb +7 -15
  14. data/lib/onebox/engine/google_play_app_onebox.rb +30 -0
  15. data/lib/onebox/engine/html.rb +10 -1
  16. data/lib/onebox/engine/image_onebox.rb +13 -0
  17. data/lib/onebox/engine/stack_exchange_onebox.rb +25 -11
  18. data/lib/onebox/engine/standard_embed.rb +48 -0
  19. data/lib/onebox/engine/twitter_status_onebox.rb +100 -0
  20. data/lib/onebox/engine/whitelisted_generic_onebox.rb +223 -0
  21. data/lib/onebox/engine/wikipedia_onebox.rb +27 -5
  22. data/lib/onebox/engine/youtube_onebox.rb +22 -0
  23. data/lib/onebox/helpers.rb +24 -0
  24. data/lib/onebox/layout.rb +67 -0
  25. data/lib/onebox/layout_support.rb +16 -0
  26. data/lib/onebox/matcher.rb +6 -1
  27. data/lib/onebox/preview.rb +19 -6
  28. data/lib/onebox/version.rb +1 -1
  29. data/lib/onebox/view.rb +7 -12
  30. data/onebox.gemspec +7 -5
  31. data/spec/fixtures/amazon.response +1336 -2971
  32. data/spec/fixtures/githubblob.response +49 -921
  33. data/spec/fixtures/{android.response → googleplayapp.response} +1 -1
  34. data/spec/fixtures/stackexchange.response +1 -1889
  35. data/spec/fixtures/twitterstatus.response +3006 -0
  36. data/spec/fixtures/youtube-json.response +1 -0
  37. data/spec/fixtures/youtube.response +1625 -0
  38. data/spec/lib/onebox/engine/amazon_onebox_spec.rb +5 -20
  39. data/spec/lib/onebox/engine/classic_google_maps_onebox_spec.rb +28 -0
  40. data/spec/lib/onebox/engine/github_blob_onebox_spec.rb +6 -15
  41. data/spec/lib/onebox/engine/github_commit_onebox_spec.rb +14 -22
  42. data/spec/lib/onebox/engine/github_gist_onebox_spec.rb +6 -14
  43. data/spec/lib/onebox/engine/github_pullrequest_onebox_spec.rb +14 -26
  44. data/spec/lib/onebox/engine/google_play_app_onebox_spec.rb +28 -0
  45. data/spec/lib/onebox/engine/html_spec.rb +4 -6
  46. data/spec/lib/onebox/engine/json_spec.rb +4 -6
  47. data/spec/lib/onebox/engine/stack_exchange_onebox_spec.rb +4 -17
  48. data/spec/lib/onebox/engine/twitter_status_onebox_spec.rb +103 -0
  49. data/spec/lib/onebox/engine/whitelisted_generic_onebox_spec.rb +51 -0
  50. data/spec/lib/onebox/engine/wikipedia_onebox_spec.rb +4 -17
  51. data/spec/lib/onebox/engine/youtube_onebox_spec.rb +17 -0
  52. data/spec/lib/onebox/engine_spec.rb +35 -32
  53. data/spec/lib/onebox/layout_spec.rb +77 -0
  54. data/spec/lib/onebox/matcher_spec.rb +0 -15
  55. data/spec/lib/onebox/preview_spec.rb +39 -9
  56. data/spec/lib/onebox_spec.rb +15 -11
  57. data/spec/spec_helper.rb +60 -4
  58. data/spec/support/html_spec_helper.rb +2 -1
  59. data/templates/_layout.mustache +11 -4
  60. data/templates/amazon.mustache +4 -3
  61. data/templates/githubblob.mustache +7 -5
  62. data/templates/githubcommit.mustache +20 -11
  63. data/templates/githubpullrequest.mustache +19 -12
  64. data/templates/googleplayapp.mustache +4 -0
  65. data/templates/stackexchange.mustache +19 -3
  66. data/templates/twitterstatus.mustache +12 -0
  67. data/templates/whitelistedgeneric.mustache +5 -0
  68. data/templates/wikipedia.mustache +4 -3
  69. metadata +57 -166
  70. data/lib/onebox/engine/bliptv_onebox.rb +0 -28
  71. data/lib/onebox/engine/clikthrough_onebox.rb +0 -25
  72. data/lib/onebox/engine/college_humor_onebox.rb +0 -27
  73. data/lib/onebox/engine/dailymotion_onebox.rb +0 -28
  74. data/lib/onebox/engine/dotsub_onebox.rb +0 -27
  75. data/lib/onebox/engine/example_onebox.rb +0 -24
  76. data/lib/onebox/engine/flickr_onebox.rb +0 -26
  77. data/lib/onebox/engine/funny_or_die_onebox.rb +0 -28
  78. data/lib/onebox/engine/hulu_onebox.rb +0 -29
  79. data/lib/onebox/engine/imgur_image_onebox.rb +0 -26
  80. data/lib/onebox/engine/itunes_onebox.rb +0 -28
  81. data/lib/onebox/engine/kinomap_onebox.rb +0 -27
  82. data/lib/onebox/engine/nfb_onebox.rb +0 -28
  83. data/lib/onebox/engine/open_graph.rb +0 -11
  84. data/lib/onebox/engine/qik_onebox.rb +0 -25
  85. data/lib/onebox/engine/revision3_onebox.rb +0 -27
  86. data/lib/onebox/engine/slideshare_onebox.rb +0 -27
  87. data/lib/onebox/engine/sound_cloud_onebox.rb +0 -27
  88. data/lib/onebox/engine/spotify_onebox.rb +0 -27
  89. data/lib/onebox/engine/ted_onebox.rb +0 -28
  90. data/lib/onebox/engine/twitter_onebox.rb +0 -31
  91. data/lib/onebox/engine/viddler_onebox.rb +0 -28
  92. data/lib/onebox/engine/vimeo_onebox.rb +0 -27
  93. data/lib/onebox/engine/yfrog_onebox.rb +0 -28
  94. data/spec/fixtures/bliptv.response +0 -724
  95. data/spec/fixtures/clikthrough.response +0 -1472
  96. data/spec/fixtures/collegehumor.response +0 -1272
  97. data/spec/fixtures/dailymotion.response +0 -575
  98. data/spec/fixtures/dotsub.response +0 -1257
  99. data/spec/fixtures/example.response +0 -50
  100. data/spec/fixtures/flickr.response +0 -1292
  101. data/spec/fixtures/funnyordie.response +0 -2010
  102. data/spec/fixtures/githubgist.response +0 -468
  103. data/spec/fixtures/hulu.response +0 -339
  104. data/spec/fixtures/imguralbum.response +0 -941
  105. data/spec/fixtures/imgurimage.response +0 -872
  106. data/spec/fixtures/itunes.response +0 -402
  107. data/spec/fixtures/kinomap.response +0 -299
  108. data/spec/fixtures/nfb.response +0 -810
  109. data/spec/fixtures/opengraph.response +0 -27
  110. data/spec/fixtures/qik.response +0 -371
  111. data/spec/fixtures/revision3.response +0 -985
  112. data/spec/fixtures/rottentomatoesfresh.response +0 -3275
  113. data/spec/fixtures/rottentomatoesincomplete.response +0 -2313
  114. data/spec/fixtures/rottentomatoesrotten.response +0 -3549
  115. data/spec/fixtures/slideshare.response +0 -1745
  116. data/spec/fixtures/soundcloud.response +0 -1409
  117. data/spec/fixtures/spotify.response +0 -250
  118. data/spec/fixtures/ted.response +0 -1341
  119. data/spec/fixtures/twitter.response +0 -1712
  120. data/spec/fixtures/viddler.response +0 -442
  121. data/spec/fixtures/vimeo.response +0 -571
  122. data/spec/fixtures/yfrog.response +0 -464
  123. data/spec/lib/onebox/engine/bliptv_onebox_spec.rb +0 -37
  124. data/spec/lib/onebox/engine/clikthrough_onebox_spec.rb +0 -29
  125. data/spec/lib/onebox/engine/college_humor_onebox_spec.rb +0 -37
  126. data/spec/lib/onebox/engine/dailymotion_onebox_spec.rb +0 -39
  127. data/spec/lib/onebox/engine/dotsub_onebox_spec.rb +0 -39
  128. data/spec/lib/onebox/engine/example_onebox_spec.rb +0 -21
  129. data/spec/lib/onebox/engine/flickr_onebox_spec.rb +0 -33
  130. data/spec/lib/onebox/engine/funny_or_die_onebox_spec.rb +0 -37
  131. data/spec/lib/onebox/engine/hulu_onebox_spec.rb +0 -37
  132. data/spec/lib/onebox/engine/imgur_image_onebox_spec.rb +0 -29
  133. data/spec/lib/onebox/engine/itunes_onebox_spec.rb +0 -29
  134. data/spec/lib/onebox/engine/kinomap_onebox_spec.rb +0 -37
  135. data/spec/lib/onebox/engine/nfb_onebox_spec.rb +0 -38
  136. data/spec/lib/onebox/engine/open_graph_spec.rb +0 -27
  137. data/spec/lib/onebox/engine/qik_onebox_spec.rb +0 -38
  138. data/spec/lib/onebox/engine/revision3_onebox_spec.rb +0 -39
  139. data/spec/lib/onebox/engine/slideshare_onebox_spec.rb +0 -33
  140. data/spec/lib/onebox/engine/sound_cloud_onebox_spec.rb +0 -39
  141. data/spec/lib/onebox/engine/spotify_onebox_spec.rb +0 -36
  142. data/spec/lib/onebox/engine/ted_onebox_spec.rb +0 -33
  143. data/spec/lib/onebox/engine/twitter_onebox_spec.rb +0 -47
  144. data/spec/lib/onebox/engine/viddler_onebox_spec.rb +0 -39
  145. data/spec/lib/onebox/engine/vimeo_onebox_spec.rb +0 -37
  146. data/spec/lib/onebox/engine/yfrog_onebox_spec.rb +0 -33
  147. data/spec/lib/onebox/view_spec.rb +0 -16
  148. data/templates/bliptv.mustache +0 -5
  149. data/templates/clikthrough.mustache +0 -4
  150. data/templates/collegehumor.mustache +0 -5
  151. data/templates/dailymotion.mustache +0 -5
  152. data/templates/dotsub.mustache +0 -5
  153. data/templates/example.mustache +0 -2
  154. data/templates/flickr.mustache +0 -4
  155. data/templates/funnyordie.mustache +0 -6
  156. data/templates/githubgist.mustache +0 -3
  157. data/templates/hulu.mustache +0 -6
  158. data/templates/imgurimage.mustache +0 -3
  159. data/templates/itunes.mustache +0 -4
  160. data/templates/kinomap.mustache +0 -5
  161. data/templates/nfb.mustache +0 -5
  162. data/templates/qik.mustache +0 -4
  163. data/templates/revision3.mustache +0 -5
  164. data/templates/slideshare.mustache +0 -4
  165. data/templates/soundcloud.mustache +0 -5
  166. data/templates/spotify.mustache +0 -4
  167. data/templates/ted.mustache +0 -5
  168. data/templates/twitter.mustache +0 -7
  169. data/templates/viddler.mustache +0 -5
  170. data/templates/vimeo.mustache +0 -5
  171. data/templates/yfrog.mustache +0 -4
@@ -1,37 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::BliptvOnebox do
4
- before(:all) do
5
- @link = "http://blip.tv"
6
- fake(@link, response(described_class.template_name))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns video title" do
18
- expect(html).to include("SC2L Week 3 - Axiom vs Acer G6")
19
- end
20
-
21
- it "returns image" do
22
- expect(html).to include("Striderdoom-SC2LWeek3AxiomVsAcerG6178-416.jpg")
23
- end
24
-
25
- it "returns video description" do
26
- expect(html).to include("Acer and Axiom go head to head in week 3!")
27
- end
28
-
29
- it "returns video" do
30
- expect(html).to include("http://blip.tv/day9tv/sc2l-week-3-axiom-vs-acer-g6-6623829")
31
- end
32
-
33
- it "returns URL" do
34
- expect(html).to include(link)
35
- end
36
- end
37
- end
@@ -1,29 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::ClikThroughOnebox do
4
- before(:all) do
5
- @link = "http://www.clikthrough.com/theater/video/49/en-US"
6
- fake(@link, response(described_class.template_name))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns video title" do
18
- expect(html).to include("Keri Hilson - Knock You Down")
19
- end
20
-
21
- it "returns video description" do
22
- expect(html).to include("Keri Hilson gets taken down by love once again")
23
- end
24
-
25
- it "returns URL" do
26
- expect(html).to include(link)
27
- end
28
- end
29
- end
@@ -1,37 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::CollegeHumorOnebox do
4
- before(:all) do
5
- @link = "http://collegehumor.com"
6
- fake(@link, response(described_class.template_name))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns video title" do
18
- expect(html).to include("Mitt Romney Style (Gangnam Style Parody)")
19
- end
20
-
21
- it "returns video image" do
22
- expect(html).to include("a9febe641d5beb264bbab0de49272e5a-mitt-romney-style-gangnam-style-parody.jpg")
23
- end
24
-
25
- it "returns video description" do
26
- expect(html).to include("Heyyy wealthy ladies!"Mitt Romney Style" is now available on iTunes")
27
- end
28
-
29
- it "returns video URL" do
30
- expect(html).to include("moogaloop.1.0.31.swf?clip_id=6830834&use_node_id=true&og=1&auto=true")
31
- end
32
-
33
- it "returns URL" do
34
- expect(html).to include(link)
35
- end
36
- end
37
- end
@@ -1,39 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::DailymotionOnebox do
4
- before(:all) do
5
- @link = "http://dailymotion.com"
6
- fake(@link, response(described_class.template_name))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns video title" do
18
- expect(html).to include("Two Door Cinema Club - Les Vielles Charrues 2013.")
19
- end
20
-
21
- it "returns video image" do
22
- expect(html).to include("526x297-bxE.jpg")
23
- end
24
-
25
- it "returns video description" do
26
- expect(html).to include("Vibrez au son de l'electro-pop des Irlandais de Two Door Cinema Club,")
27
- end
28
-
29
- it "returns video URL" do
30
- expect(html).to include("http://www.dailymotion.com/swf/video/x12h020?autoPlay=1")
31
- end
32
-
33
- it "returns video embed code"
34
-
35
- it "returns URL" do
36
- expect(html).to include(link)
37
- end
38
- end
39
- end
@@ -1,39 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::DotsubOnebox do
4
- before(:all) do
5
- @link = "http://dotsub.com/view/665bd0d5-a9f4-4a07-9d9e-b31ba926ca78"
6
- fake(@link, response(described_class.template_name))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns video title" do
18
- expect(html).to include("Twitter in Plain English")
19
- end
20
-
21
- it "returns video description" do
22
- # og:decription tag spelled wrong in http response
23
- pending
24
- expect(html).to include("A short explanation of the micro-blogging service, Twitter.")
25
- end
26
-
27
- it "returns video photo" do
28
- expect(html).to include("/665bd0d5-a9f4-4a07-9d9e-b31ba926ca78/p")
29
- end
30
-
31
- it "returns video URL" do
32
- expect(html).to include("dotsub.com/media/665bd0d5-a9f4-4a07-9d9e-b31ba926ca78/m/flv/")
33
- end
34
-
35
- it "returns URL" do
36
- expect(html).to include("http://dotsub.com/view/665bd0d5-a9f4-4a07-9d9e-b31ba926ca78")
37
- end
38
- end
39
- end
@@ -1,21 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::ExampleOnebox do
4
- before(:all) do
5
- @link = "http://example.com"
6
- fake(@link, response(described_class.template_name))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns template if given valid data" do
18
- expect(html).to include("Example Domain 1")
19
- end
20
- end
21
- end
@@ -1,33 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::FlickrOnebox do
4
- before(:all) do
5
- @link = "http://flickr.com"
6
- fake(@link, response(described_class.template_name))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns photo title" do
18
- expect(html).to include("Los Angeles View 2011")
19
- end
20
-
21
- it "returns photo" do
22
- expect(html).to include("6038315155_2875860c4b_z.jpg")
23
- end
24
-
25
- it "returns photo description" do
26
- expect(html).to include("The view from the Griffith Observatory, Los Angeles; July 2011")
27
- end
28
-
29
- it "returns URL" do
30
- expect(html).to include(link)
31
- end
32
- end
33
- end
@@ -1,37 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::FunnyOrDieOnebox do
4
- before(:all) do
5
- @link = "http://funnyordie.com"
6
- fake(@link, response(described_class.template_name))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns video title" do
18
- expect(html).to include("The Landlord")
19
- end
20
-
21
- it "returns video photo" do
22
- expect(html).to include("c480x270_18.jpg")
23
- end
24
-
25
- it "returns video description" do
26
- expect(html).to include("Will Ferrell meets his landlord.")
27
- end
28
-
29
- it "returns video URL" do
30
- expect(html).to include("http://www.funnyordie.com/videos/74/the-landlord-from-will-ferrell-and-adam-ghost-panther-mckay")
31
- end
32
-
33
- it "returns URL" do
34
- expect(html).to include(link)
35
- end
36
- end
37
- end
@@ -1,37 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::HuluOnebox do
4
- before(:all) do
5
- @link = "http://www.hulu.com/watch/515146"
6
- fake(@link, response(described_class.template_name))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns video title" do
18
- expect(html).to include("The Awesomes: Pilot, Part 1")
19
- end
20
-
21
- it "returns photo" do
22
- expect(html).to include("http://ib3.huluim.com/video/60245466?region=US&size=600x400")
23
- end
24
-
25
- it "returns video description" do
26
- expect(html).to include("After Mr. Awesome decides to retire and disband The Awesomes")
27
- end
28
-
29
- it "returns video URL" do
30
- expect(html).to include("https://secure.hulu.com/embed/0-us7uHJgevua5TeiGwCxQ")
31
- end
32
-
33
- it "returns URL" do
34
- expect(html).to include(link)
35
- end
36
- end
37
- end
@@ -1,29 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::ImgurImageOnebox do
4
- before(:all) do
5
- @link = "http://imgur.com/gallery/twoDTCU"
6
- fake(@link, response(described_class.template_name))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns the image title" do
18
- expect(html).to include("My dog likes to hug me")
19
- end
20
-
21
- it "returns the image" do
22
- expect(html).to include("twoDTCU.jpg")
23
- end
24
-
25
- it "returns URL" do
26
- expect(html).to include(link)
27
- end
28
- end
29
- end
@@ -1,29 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::ItunesOnebox do
4
- before(:all) do
5
- @link = "https://itunes.apple.com/us/app/minecraft-pocket-edition/id479516143?mt=8"
6
- fake(@link, response("itunes"))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns the product title" do
18
- expect(html).to include("Minecraft – Pocket Edition")
19
- end
20
-
21
- it "returns the product image" do
22
- expect(html).to include("bxerxqln.png")
23
- end
24
-
25
- it "returns the product description" do
26
- expect(html).to include("Get Minecraft – Pocket Edition on the App Store.")
27
- end
28
- end
29
- end
@@ -1,37 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::KinomapOnebox do
4
- before(:all) do
5
- @link = "http://www.kinomap.com/watch/52wjcu"
6
- fake(@link, response(described_class.template_name))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns video title" do
18
- expect(html).to include("Enduro Jeunes Touquet - Nicolas Letévé")
19
- end
20
-
21
- it "returns video photo" do
22
- expect(html).to include("52wjcu_320x240.jpg")
23
- end
24
-
25
- it "returns video description" do
26
- expect(html).to include("A partir du parc moto,")
27
- end
28
-
29
- it "returns video URL" do
30
- expect(html).to include("http://v2.kinomap.com/embed/52wjcu")
31
- end
32
-
33
- it "returns URL" do
34
- expect(html).to include(link)
35
- end
36
- end
37
- end
@@ -1,38 +0,0 @@
1
- require "spec_helper"
2
-
3
- describe Onebox::Engine::NFBOnebox do
4
- before(:all) do
5
- @link = "http://www.nfb.ca/film/overdose"
6
- fake(@link, response(described_class.template_name))
7
- end
8
- before(:each) { Onebox.defaults.cache.clear }
9
-
10
- let(:link) { @link }
11
-
12
- it_behaves_like "an engine"
13
-
14
- describe "#to_html" do
15
- let(:html) { described_class.new(link).to_html }
16
-
17
- it "returns video title" do
18
- expect(html).to include("Overdose")
19
- end
20
-
21
- it "returns video description" do
22
- expect(html).to include("With school, tennis lessons, swimming lessons, art classes,")
23
- end
24
-
25
- it "returns video URL" do
26
- expect(html).to include("http://www.nfb.ca/film/overdose_en/")
27
- end
28
-
29
- it "returns the video embed code" do
30
- pending
31
- expect(html).to include("")
32
- end
33
-
34
- it "returns URL" do
35
- expect(html).to include(link)
36
- end
37
- end
38
- end