spec/lib/onebox/engine/youtube_onebox_spec.rb in onebox-1.5.21 vs spec/lib/onebox/engine/youtube_onebox_spec.rb in onebox-1.5.22
- old
+ new
@@ -1,11 +1,12 @@
require 'spec_helper'
describe Onebox::Engine::YoutubeOnebox do
before do
- fake("http://www.youtube.com/watch?feature=player_embedded&v=21Lk4YiASMo", response("youtube"))
+ fake("https://www.youtube.com/watch?feature=player_embedded&v=21Lk4YiASMo", response("youtube"))
fake("https://www.youtube.com/channel/UCL8ZULXASCc1I_oaOT0NaOQ", response("youtube-channel"))
+ fake("https://www.youtube.com/playlist?list=PL5308B2E5749D1696", response("youtube-playlist"))
end
it "adds wmode=opaque" do
expect(Onebox.preview('https://www.youtube.com/watch?v=21Lk4YiASMo')
.to_s).to match(/wmode=opaque/)
@@ -29,10 +30,11 @@
end
it "can onebox a playlist" do
pending('no opengraph on playlists, needs special handling')
- Onebox.preview('https://www.youtube.com/playlist?list=PL5308B2E5749D1696').to_s
+ expect(Onebox.preview('https://www.youtube.com/playlist?list=PL5308B2E5749D1696')
+ .to_s).to match(/Dear Sophie/)
end
it "does not make HTTP requests unless necessary" do
# We haven't defined any fixture for requests associated with this ID, so if
# any HTTP requests are made fakeweb will complain and the test will fail.