~ubuntu-branches/ubuntu/wily/tdiary/wily

« back to all changes in this revision

Viewing changes to contrib2/spec/youtube_spec.rb

  • Committer: Bazaar Package Importer
  • Author(s): Daigo Moriwaki
  • Date: 2011-04-11 21:53:16 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110411215316-ih4gt4q8p29d2wf8
Tags: 3.0.1-1
* New upstream release (Closes: #542801, #594947)
* debian/control:
 - Bumped up Standards-Version to 3.9.1.
 - Updated version dependency.
* debian/tdiary-setup.rb: Followed the upstream changes, incorporating js and
  index.fcgi

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
$:.unshift(File.dirname(__FILE__))
 
2
require 'spec_helper'
 
3
 
 
4
describe "youtube plugin" do
 
5
        DUMMY_YOUTUBE_VIDEO_ID = 1234567890
 
6
 
 
7
  with_fixtures :user_agent => :expected do
 
8
    it 'should render object tag in :user_agent' do |user_agent, expected|
 
9
      cgi = CGIFake.new
 
10
      plugin = fake_plugin(:youtube)
 
11
      cgi.user_agent = user_agent
 
12
      plugin.conf.cgi = cgi
 
13
      plugin.youtube(DUMMY_YOUTUBE_VIDEO_ID).should == expected
 
14
    end
 
15
 
 
16
    set_fixtures([
 
17
      ['DoCoMo'  => 
 
18
          %|<div class="youtube"><a href="http://www.youtube.com/watch?v=#{DUMMY_YOUTUBE_VIDEO_ID}">YouTube (#{DUMMY_YOUTUBE_VIDEO_ID})</a></div>| 
 
19
      ],
 
20
      ['iPhone'  => 
 
21
          %|<div class="youtube"><a href="youtube:#{DUMMY_YOUTUBE_VIDEO_ID}">YouTube (#{DUMMY_YOUTUBE_VIDEO_ID})</a></div>|
 
22
      ],
 
23
      ["Mozilla" => 
 
24
          %|\t\t<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/#{DUMMY_YOUTUBE_VIDEO_ID}"></param><embed src="http://www.youtube.com/v/#{DUMMY_YOUTUBE_VIDEO_ID}" type="application/x-shockwave-flash" width="425" height="350"></embed></object>
 
25
|
 
26
      ],
 
27
    ])
 
28
  end
 
29
end
 
30