From 5f0220bb123e8ac2aea9050ac4a6dca13a39f3db Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Tue, 19 Apr 2011 17:52:44 -0400 Subject: [PATCH] added tests for rails helper --- spec/rails_helper_spec.rb | 29 +++++++++++++++++++++++++++++ spec/spec_helper.rb | 3 ++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 spec/rails_helper_spec.rb 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