added tests for rails helper

This commit is contained in:
Scott Davis 2011-04-19 17:52:44 -04:00
parent cc2d7098d6
commit 5f0220bb12
2 changed files with 31 additions and 1 deletions

29
spec/rails_helper_spec.rb Normal file
View File

@ -0,0 +1,29 @@
class String
def html_safe
self
end
end
describe Flowplayer::Helper do
include Flowplayer::Helper
it "should render player" do
flow_player = flowplayer_for('my_video', 'commericial.swf') do |player|
player.fullscreen true
player.logo(:url => nil, :opacity => 0, :fullscreenOnly => true)
end
flow_player.should include('$(document).ready(function() {')
end
it "should support prototype" do
flow_player = flowplayer_for('my_video', 'commericial.swf', 'prototype') do |player|
player.fullscreen true
player.logo(:url => nil, :opacity => 0, :fullscreenOnly => true)
end
flow_player.should include('document.observe("dom:loaded", function() {')
end
end

View File

@ -1 +1,2 @@
require File.expand_path('../../lib/flowplayer', __FILE__) require File.expand_path('../../lib/flowplayer', __FILE__)
require 'flowplayer/railties/helper'