Sha256: f09e916c34c58eedd9b4523a4627bbf75204d0fade3de88af71cf61ea4502f5a

Contents?: true

Size: 1.53 KB

Versions: 3

Compression:

Stored size: 1.53 KB

Contents

require File.expand_path(File.dirname(__FILE__) + "/../spec_helper")

describe Animoto::Footage do
  
  it "should be a visual" do
    Animoto::Footage.should include(Animoto::Visual)
  end
  
  describe "#to_hash" do
    before do
      @footage = Animoto::Footage.new 'http://website.com/movie.mp4'
    end
    
    it "should have a 'source_url' key with the url" do
      @footage.to_hash.should have_key('source_url')
      @footage.to_hash['source_url'].should == @footage.source
    end
    
    it "should not have a 'spotlit' key" do
      @footage.to_hash.should_not have_key('spotlit')
    end
    
    describe "if audio mixing is turned on" do
      before do
        @footage.audio_mix = true
      end
      
      it "should have an 'audio_mix' key telling how to mix" do
        @footage.to_hash.should have_key('audio_mix')
        @footage.to_hash['audio_mix'].should == 'MIX'
      end
    end
    
    describe "if using a different start time" do
      before do
        @footage.start_time = 10.5
      end
      
      it "should have a 'start_time' key with the starting time" do
        @footage.to_hash.should have_key('start_time')
        @footage.to_hash['start_time'].should == @footage.start_time
      end
    end
    
    describe "if a duration was specified" do
      before do
        @footage.duration = 300
      end
      
      it "should have a 'duration' key with the duration" do
        @footage.to_hash.should have_key('duration')
        @footage.to_hash['duration'].should == @footage.duration
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
animoto-0.0.0.alpha9 ./spec/animoto/footage_spec.rb
animoto-0.0.0.alpha8 ./spec/animoto/footage_spec.rb
animoto-0.0.0.alpha7 ./spec/animoto/footage_spec.rb