File: youtube_spec.rb

package info (click to toggle)
tdiary-contrib 5.0.11-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,660 kB
  • sloc: ruby: 17,024; lisp: 546; xml: 451; php: 61; sql: 40; makefile: 18
file content (18 lines) | stat: -rw-r--r-- 634 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$:.unshift(File.dirname(__FILE__))
require 'spec_helper'

describe "youtube plugin" do
	DUMMY_YOUTUBE_VIDEO_ID = 1234567890

  {
    'Mozilla' => %|\t\t<div class="youtube-player-wrapper">\n\t\t<iframe class="youtube-player" type="text/html" width="425" height="350" src="//www.youtube.com/embed/#{DUMMY_YOUTUBE_VIDEO_ID}" frameborder="0">\n\t\t</iframe>\n\t\t</div>\n|
  }.each do |k,v|
    it 'should render object tag in :user_agent' do
      plugin = fake_plugin(:youtube)
      cgi = CGIFake.new
      cgi.user_agent = k
      plugin.conf.cgi = cgi
      expect(plugin.youtube(DUMMY_YOUTUBE_VIDEO_ID)).to eq(v)
    end
  end
end