onebox 1.1.0 → 1.2.0
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/.gitignore +1 -0
- data/.rubocop.yml +7 -452
- data/Gemfile +1 -1
- data/README.md +23 -45
- data/lib/onebox.rb +21 -13
- data/lib/onebox/engine.rb +53 -43
- data/lib/onebox/engine/amazon_onebox.rb +34 -7
- data/lib/onebox/engine/classic_google_maps_onebox.rb +37 -0
- data/lib/onebox/engine/github_blob_onebox.rb +27 -7
- data/lib/onebox/engine/github_commit_onebox.rb +8 -15
- data/lib/onebox/engine/github_gist_onebox.rb +10 -10
- data/lib/onebox/engine/github_pullrequest_onebox.rb +7 -15
- data/lib/onebox/engine/google_play_app_onebox.rb +30 -0
- data/lib/onebox/engine/html.rb +10 -1
- data/lib/onebox/engine/image_onebox.rb +13 -0
- data/lib/onebox/engine/stack_exchange_onebox.rb +25 -11
- data/lib/onebox/engine/standard_embed.rb +48 -0
- data/lib/onebox/engine/twitter_status_onebox.rb +100 -0
- data/lib/onebox/engine/whitelisted_generic_onebox.rb +223 -0
- data/lib/onebox/engine/wikipedia_onebox.rb +27 -5
- data/lib/onebox/engine/youtube_onebox.rb +22 -0
- data/lib/onebox/helpers.rb +24 -0
- data/lib/onebox/layout.rb +67 -0
- data/lib/onebox/layout_support.rb +16 -0
- data/lib/onebox/matcher.rb +6 -1
- data/lib/onebox/preview.rb +19 -6
- data/lib/onebox/version.rb +1 -1
- data/lib/onebox/view.rb +7 -12
- data/onebox.gemspec +7 -5
- data/spec/fixtures/amazon.response +1336 -2971
- data/spec/fixtures/githubblob.response +49 -921
- data/spec/fixtures/{android.response → googleplayapp.response} +1 -1
- data/spec/fixtures/stackexchange.response +1 -1889
- data/spec/fixtures/twitterstatus.response +3006 -0
- data/spec/fixtures/youtube-json.response +1 -0
- data/spec/fixtures/youtube.response +1625 -0
- data/spec/lib/onebox/engine/amazon_onebox_spec.rb +5 -20
- data/spec/lib/onebox/engine/classic_google_maps_onebox_spec.rb +28 -0
- data/spec/lib/onebox/engine/github_blob_onebox_spec.rb +6 -15
- data/spec/lib/onebox/engine/github_commit_onebox_spec.rb +14 -22
- data/spec/lib/onebox/engine/github_gist_onebox_spec.rb +6 -14
- data/spec/lib/onebox/engine/github_pullrequest_onebox_spec.rb +14 -26
- data/spec/lib/onebox/engine/google_play_app_onebox_spec.rb +28 -0
- data/spec/lib/onebox/engine/html_spec.rb +4 -6
- data/spec/lib/onebox/engine/json_spec.rb +4 -6
- data/spec/lib/onebox/engine/stack_exchange_onebox_spec.rb +4 -17
- data/spec/lib/onebox/engine/twitter_status_onebox_spec.rb +103 -0
- data/spec/lib/onebox/engine/whitelisted_generic_onebox_spec.rb +51 -0
- data/spec/lib/onebox/engine/wikipedia_onebox_spec.rb +4 -17
- data/spec/lib/onebox/engine/youtube_onebox_spec.rb +17 -0
- data/spec/lib/onebox/engine_spec.rb +35 -32
- data/spec/lib/onebox/layout_spec.rb +77 -0
- data/spec/lib/onebox/matcher_spec.rb +0 -15
- data/spec/lib/onebox/preview_spec.rb +39 -9
- data/spec/lib/onebox_spec.rb +15 -11
- data/spec/spec_helper.rb +60 -4
- data/spec/support/html_spec_helper.rb +2 -1
- data/templates/_layout.mustache +11 -4
- data/templates/amazon.mustache +4 -3
- data/templates/githubblob.mustache +7 -5
- data/templates/githubcommit.mustache +20 -11
- data/templates/githubpullrequest.mustache +19 -12
- data/templates/googleplayapp.mustache +4 -0
- data/templates/stackexchange.mustache +19 -3
- data/templates/twitterstatus.mustache +12 -0
- data/templates/whitelistedgeneric.mustache +5 -0
- data/templates/wikipedia.mustache +4 -3
- metadata +57 -166
- data/lib/onebox/engine/bliptv_onebox.rb +0 -28
- data/lib/onebox/engine/clikthrough_onebox.rb +0 -25
- data/lib/onebox/engine/college_humor_onebox.rb +0 -27
- data/lib/onebox/engine/dailymotion_onebox.rb +0 -28
- data/lib/onebox/engine/dotsub_onebox.rb +0 -27
- data/lib/onebox/engine/example_onebox.rb +0 -24
- data/lib/onebox/engine/flickr_onebox.rb +0 -26
- data/lib/onebox/engine/funny_or_die_onebox.rb +0 -28
- data/lib/onebox/engine/hulu_onebox.rb +0 -29
- data/lib/onebox/engine/imgur_image_onebox.rb +0 -26
- data/lib/onebox/engine/itunes_onebox.rb +0 -28
- data/lib/onebox/engine/kinomap_onebox.rb +0 -27
- data/lib/onebox/engine/nfb_onebox.rb +0 -28
- data/lib/onebox/engine/open_graph.rb +0 -11
- data/lib/onebox/engine/qik_onebox.rb +0 -25
- data/lib/onebox/engine/revision3_onebox.rb +0 -27
- data/lib/onebox/engine/slideshare_onebox.rb +0 -27
- data/lib/onebox/engine/sound_cloud_onebox.rb +0 -27
- data/lib/onebox/engine/spotify_onebox.rb +0 -27
- data/lib/onebox/engine/ted_onebox.rb +0 -28
- data/lib/onebox/engine/twitter_onebox.rb +0 -31
- data/lib/onebox/engine/viddler_onebox.rb +0 -28
- data/lib/onebox/engine/vimeo_onebox.rb +0 -27
- data/lib/onebox/engine/yfrog_onebox.rb +0 -28
- data/spec/fixtures/bliptv.response +0 -724
- data/spec/fixtures/clikthrough.response +0 -1472
- data/spec/fixtures/collegehumor.response +0 -1272
- data/spec/fixtures/dailymotion.response +0 -575
- data/spec/fixtures/dotsub.response +0 -1257
- data/spec/fixtures/example.response +0 -50
- data/spec/fixtures/flickr.response +0 -1292
- data/spec/fixtures/funnyordie.response +0 -2010
- data/spec/fixtures/githubgist.response +0 -468
- data/spec/fixtures/hulu.response +0 -339
- data/spec/fixtures/imguralbum.response +0 -941
- data/spec/fixtures/imgurimage.response +0 -872
- data/spec/fixtures/itunes.response +0 -402
- data/spec/fixtures/kinomap.response +0 -299
- data/spec/fixtures/nfb.response +0 -810
- data/spec/fixtures/opengraph.response +0 -27
- data/spec/fixtures/qik.response +0 -371
- data/spec/fixtures/revision3.response +0 -985
- data/spec/fixtures/rottentomatoesfresh.response +0 -3275
- data/spec/fixtures/rottentomatoesincomplete.response +0 -2313
- data/spec/fixtures/rottentomatoesrotten.response +0 -3549
- data/spec/fixtures/slideshare.response +0 -1745
- data/spec/fixtures/soundcloud.response +0 -1409
- data/spec/fixtures/spotify.response +0 -250
- data/spec/fixtures/ted.response +0 -1341
- data/spec/fixtures/twitter.response +0 -1712
- data/spec/fixtures/viddler.response +0 -442
- data/spec/fixtures/vimeo.response +0 -571
- data/spec/fixtures/yfrog.response +0 -464
- data/spec/lib/onebox/engine/bliptv_onebox_spec.rb +0 -37
- data/spec/lib/onebox/engine/clikthrough_onebox_spec.rb +0 -29
- data/spec/lib/onebox/engine/college_humor_onebox_spec.rb +0 -37
- data/spec/lib/onebox/engine/dailymotion_onebox_spec.rb +0 -39
- data/spec/lib/onebox/engine/dotsub_onebox_spec.rb +0 -39
- data/spec/lib/onebox/engine/example_onebox_spec.rb +0 -21
- data/spec/lib/onebox/engine/flickr_onebox_spec.rb +0 -33
- data/spec/lib/onebox/engine/funny_or_die_onebox_spec.rb +0 -37
- data/spec/lib/onebox/engine/hulu_onebox_spec.rb +0 -37
- data/spec/lib/onebox/engine/imgur_image_onebox_spec.rb +0 -29
- data/spec/lib/onebox/engine/itunes_onebox_spec.rb +0 -29
- data/spec/lib/onebox/engine/kinomap_onebox_spec.rb +0 -37
- data/spec/lib/onebox/engine/nfb_onebox_spec.rb +0 -38
- data/spec/lib/onebox/engine/open_graph_spec.rb +0 -27
- data/spec/lib/onebox/engine/qik_onebox_spec.rb +0 -38
- data/spec/lib/onebox/engine/revision3_onebox_spec.rb +0 -39
- data/spec/lib/onebox/engine/slideshare_onebox_spec.rb +0 -33
- data/spec/lib/onebox/engine/sound_cloud_onebox_spec.rb +0 -39
- data/spec/lib/onebox/engine/spotify_onebox_spec.rb +0 -36
- data/spec/lib/onebox/engine/ted_onebox_spec.rb +0 -33
- data/spec/lib/onebox/engine/twitter_onebox_spec.rb +0 -47
- data/spec/lib/onebox/engine/viddler_onebox_spec.rb +0 -39
- data/spec/lib/onebox/engine/vimeo_onebox_spec.rb +0 -37
- data/spec/lib/onebox/engine/yfrog_onebox_spec.rb +0 -33
- data/spec/lib/onebox/view_spec.rb +0 -16
- data/templates/bliptv.mustache +0 -5
- data/templates/clikthrough.mustache +0 -4
- data/templates/collegehumor.mustache +0 -5
- data/templates/dailymotion.mustache +0 -5
- data/templates/dotsub.mustache +0 -5
- data/templates/example.mustache +0 -2
- data/templates/flickr.mustache +0 -4
- data/templates/funnyordie.mustache +0 -6
- data/templates/githubgist.mustache +0 -3
- data/templates/hulu.mustache +0 -6
- data/templates/imgurimage.mustache +0 -3
- data/templates/itunes.mustache +0 -4
- data/templates/kinomap.mustache +0 -5
- data/templates/nfb.mustache +0 -5
- data/templates/qik.mustache +0 -4
- data/templates/revision3.mustache +0 -5
- data/templates/slideshare.mustache +0 -4
- data/templates/soundcloud.mustache +0 -5
- data/templates/spotify.mustache +0 -4
- data/templates/ted.mustache +0 -5
- data/templates/twitter.mustache +0 -7
- data/templates/viddler.mustache +0 -5
- data/templates/vimeo.mustache +0 -5
- data/templates/yfrog.mustache +0 -4
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe Onebox::Engine::OpenGraph do
|
|
4
|
-
before(:all) do
|
|
5
|
-
@link = "http://flickr.com"
|
|
6
|
-
fake(@link, response("flickr"))
|
|
7
|
-
end
|
|
8
|
-
before(:each) { Onebox.defaults.cache.clear }
|
|
9
|
-
|
|
10
|
-
let(:link) { @link }
|
|
11
|
-
|
|
12
|
-
describe "#raw" do
|
|
13
|
-
class OneboxEngineOpenGraph
|
|
14
|
-
include Onebox::Engine
|
|
15
|
-
include Onebox::Engine::OpenGraph
|
|
16
|
-
|
|
17
|
-
def initialize(link)
|
|
18
|
-
@url = link
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it "returns a OpenGraph object that has a metadata method" do
|
|
23
|
-
object = OneboxEngineOpenGraph.new("http://flickr.com").send(:raw)
|
|
24
|
-
expect(object).to respond_to(:metadata)
|
|
25
|
-
end
|
|
26
|
-
end
|
|
27
|
-
end
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe Onebox::Engine::QikOnebox do
|
|
4
|
-
before(:all) do
|
|
5
|
-
@link = "http://qik.com/video/13430626"
|
|
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 video title" do
|
|
18
|
-
expect(html).to include("20910")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "returns the video author" do
|
|
22
|
-
expect(html).to include("mitesh patel")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it "returns the video uploader photo" do
|
|
26
|
-
expect(html).to include("me_large.jpg")
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "returns the video URL" do
|
|
30
|
-
expect(html).to include(link)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it "returns the video embed code" do
|
|
34
|
-
pending
|
|
35
|
-
expect(html).to include("clsid:d27cdb6e-ae6d-11cf-96b8-444553540000")
|
|
36
|
-
end
|
|
37
|
-
end
|
|
38
|
-
end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe Onebox::Engine::Revision3Onebox do
|
|
4
|
-
before(:all) do
|
|
5
|
-
@link = "http://revision3.com/discoverysharks/blue-sharks"
|
|
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("Blue Shark Bites Diver's Arm")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "returns video image" do
|
|
22
|
-
expect(html).to include("discoverysharks--0029--blue-sharks--medium.thumb.jpg")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it "returns video description" do
|
|
26
|
-
expect(html).to include("Blue Sharks swimming and eating in the open ocean.")
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "returns video URL" do
|
|
30
|
-
expect(html).to include("https://revision3.com/player-v22668")
|
|
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,33 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe Onebox::Engine::SlideshareOnebox do
|
|
4
|
-
before(:all) do
|
|
5
|
-
@link = "http://www.slideshare.net/TravelWorldPassport/12-local-traditions"
|
|
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 presentation title" do
|
|
18
|
-
expect(html).to include("12 Local Traditions That")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "returns presentation description" do
|
|
22
|
-
expect(html).to include("12 Local traditions that will make")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it "returns presentation image" do
|
|
26
|
-
expect(html).to include("12localtraditions-130729070157-phpapp01-thumbnail-4")
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "returns URL" do
|
|
30
|
-
expect(html).to include(link)
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe Onebox::Engine::SoundCloudOnebox do
|
|
4
|
-
before(:all) do
|
|
5
|
-
@link = "https://soundcloud.com/rac/penguin-prison-worse-it-gets-rac-mix"
|
|
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("Penguin Prison - Worse It Gets (RAC Mix)")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "returns video image" do
|
|
22
|
-
expect(html).to include("artworks-000033643332-vpuznu-t500x500.jpg")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it "returns video description" do
|
|
26
|
-
expect(html).to include("Remix by André Allen Anjos.")
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "returns video URL" do
|
|
30
|
-
expect(html).to include("Remix by André Allen Anjos.")
|
|
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,36 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe Onebox::Engine::SpotifyOnebox do
|
|
4
|
-
before(:all) do
|
|
5
|
-
@link = "http://open.spotify.com/album/3eEtlM70GU40OyHMotY15N"
|
|
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 album title" do
|
|
18
|
-
title = "Keep Moving Forward EP"
|
|
19
|
-
expect(html).to include(title)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it "returns album description" do
|
|
23
|
-
description = "Keep Moving Forward EP, an album by Bubble on Spotify"
|
|
24
|
-
expect(html).to include(description)
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
it "returns album image" do
|
|
28
|
-
image = "http://o.scdn.co/image/d2c3de070317af4aae4e03daa976690431f1849d"
|
|
29
|
-
expect(html).to include(image)
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it "returns URL" do
|
|
33
|
-
expect(html).to include(link)
|
|
34
|
-
end
|
|
35
|
-
end
|
|
36
|
-
end
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe Onebox::Engine::TedOnebox do
|
|
4
|
-
before(:all) do
|
|
5
|
-
@link = "http://www.ted.com/talks/eli_beer_the_fastest_ambulance_a_motorcycle.html"
|
|
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("Eli Beer: The fastest ambulance? A motorcycle")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "returns video photo" do
|
|
22
|
-
expect(html).to include("aa8d0403aec3466d031e3e1c1605637d84d6a07d_389x292.jpg")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it "returns video description" do
|
|
26
|
-
expect(html).to include("As a young EMT on a Jerusalem ambulance")
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "returns URL" do
|
|
30
|
-
expect(html).to include(link)
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe Onebox::Engine::TwitterOnebox do
|
|
4
|
-
before(:all) do
|
|
5
|
-
@link = "https://twitter.com/toastergrrl/status/363116819147538433"
|
|
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 "has tweet text" do
|
|
18
|
-
expect(html).to include("I'm a sucker for pledges.")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "has tweet time and date" do
|
|
22
|
-
expect(html).to include("6:59 PM - 1 Aug 13")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it "has user name" do
|
|
26
|
-
expect(html).to include("@toastergrrl")
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "has user avatar" do
|
|
30
|
-
expect(html).to include("39b969d32a10b2437563e246708c8f9d_normal.jpeg")
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it "has tweet favorite count" do
|
|
34
|
-
pending
|
|
35
|
-
expect(html).to include("")
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
it "has retweet count" do
|
|
39
|
-
pending
|
|
40
|
-
expect(html).to include("")
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
it "has URL" do
|
|
44
|
-
expect(html).to include(link)
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe Onebox::Engine::ViddlerOnebox do
|
|
4
|
-
before(:all) do
|
|
5
|
-
@link = "http://www.viddler.com/v/7164f749"
|
|
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("Viddler Demo")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "returns video image" do
|
|
22
|
-
expect(html).to include("thumbnail_2_7164f749_v2.jpg")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it "returns video description" do
|
|
26
|
-
expect(html).to include("Get familiar with your Viddler account.")
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "returns video URL" do
|
|
30
|
-
expect(html).to include("http://www.viddler.com/player/7164f749")
|
|
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,37 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe Onebox::Engine::VimeoOnebox do
|
|
4
|
-
before(:all) do
|
|
5
|
-
@link = "http://vimeo.com/70437049"
|
|
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("108 years of Herman Miller in 108 seconds")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "returns video photo" do
|
|
22
|
-
expect(html).to include("443673159_1280.jpg")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it "returns video description" do
|
|
26
|
-
expect(html).to include("To mark the launch of a new website for Hermann Miller furniture")
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "returns video URL" do
|
|
30
|
-
expect(html).to include("http://vimeo.com/moogaloop.swf?clip_id=70437049")
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it "returns URL" do
|
|
34
|
-
expect(html).to include(link)
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
end
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe Onebox::Engine::YfrogOnebox do
|
|
4
|
-
before(:each) { Onebox.defaults.cache.clear }
|
|
5
|
-
before(:all) do
|
|
6
|
-
@link = "http://twitter.yfrog.com/h0jjdobj?sa=0"
|
|
7
|
-
fake(@link, response(described_class.template_name))
|
|
8
|
-
end
|
|
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("Celebrating @questlove Cook4Quest w/WyattCenac")
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "returns photo" do
|
|
22
|
-
expect(html).to include("jjdob.jpg")
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it "returns photo description" do
|
|
26
|
-
expect(html).to include("Click on the photo to comment, share or view other great photos")
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "returns URL" do
|
|
30
|
-
expect(html).to include(link)
|
|
31
|
-
end
|
|
32
|
-
end
|
|
33
|
-
end
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
require "spec_helper"
|
|
2
|
-
|
|
3
|
-
describe Onebox::View do
|
|
4
|
-
let(:view) { described_class.new("example", true) }
|
|
5
|
-
let(:html) { view.to_html({ url: "http://example.com" }) }
|
|
6
|
-
|
|
7
|
-
describe "#to_html" do
|
|
8
|
-
it "renders engine partial within layout template" do
|
|
9
|
-
expect(html).to include(%|class="onebox"|)
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
it "renders the url" do
|
|
13
|
-
expect(html).to include("http://example.com")
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
end
|
data/templates/bliptv.mustache
DELETED