root/platform/tdiary/spec/youtube_spec.rb

Revision 6635, 1.1 kB (checked in by hsbt, 10 months ago)

platform/tdiary/spec: merge from spec_with_rspec-fixture.

Line 
1$:.unshift(File.dirname(__FILE__))
2require 'spec_helper'
3
4describe "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
29end
30
Note: See TracBrowser for help on using the browser.