diff --git a/spec/rails_helper_spec.rb b/spec/rails_helper_spec.rb new file mode 100644 index 0000000..436b0e2 --- /dev/null +++ b/spec/rails_helper_spec.rb @@ -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 \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 79f7869..0ee4f90 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1 +1,2 @@ -require File.expand_path('../../lib/flowplayer', __FILE__) \ No newline at end of file +require File.expand_path('../../lib/flowplayer', __FILE__) +require 'flowplayer/railties/helper' \ No newline at end of file