|
Revision 37332, 1.0 kB
(checked in by drry, 3 years ago)
|
- fixed regexes.
- fixed HTML.
- et cetera.
|
| Line | |
|---|
| 1 | $:.unshift(File.dirname(__FILE__)) |
|---|
| 2 | require 'spec_helper' |
|---|
| 3 | |
|---|
| 4 | describe "google_video plugin" do |
|---|
| 5 | DUMMY_VIDEO_ID = 1234567890 |
|---|
| 6 | |
|---|
| 7 | with_fixtures [:width, :height] => :expected do |
|---|
| 8 | it 'should render :width x :height object tag' do |input, expected| |
|---|
| 9 | plugin = fake_plugin(:google_video) |
|---|
| 10 | snippet = plugin.google_video(DUMMY_VIDEO_ID, "#{input[:width]}x#{input[:height]}") |
|---|
| 11 | snippet.should == expected |
|---|
| 12 | end |
|---|
| 13 | |
|---|
| 14 | filters({ |
|---|
| 15 | :expected => lambda {|val| |
|---|
| 16 | width, height = *val |
|---|
| 17 | doc_id = DUMMY_VIDEO_ID |
|---|
| 18 | |
|---|
| 19 | %|<object class="googlevideo" width="#{width}" height="#{height}"><param name="movie" value="http://video.google.com/googleplayer.swf?docId=#{doc_id}&hl=en"><embed src="http://video.google.com/googleplayer.swf?docId=#{doc_id}&hl=en" type="application/x-shockwave-flash" width="#{width}" height="#{height}"></embed></object>| |
|---|
| 20 | }, |
|---|
| 21 | }) |
|---|
| 22 | |
|---|
| 23 | set_fixtures([ |
|---|
| 24 | [ [212, 160] => [212, 160] ], |
|---|
| 25 | [ [425, 320] => [425, 320] ], |
|---|
| 26 | ]) |
|---|
| 27 | end |
|---|
| 28 | end |
|---|