Sha256: 0aa8f3170a047874b173cb3fe8da9f63d5373289860ca61baf4b2396a652e906

Contents?: true

Size: 1.56 KB

Versions: 10

Compression:

Stored size: 1.56 KB

Contents

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

describe Animoto::Resources::Storyboard do

  it "should have content type 'application/vnd.animoto.storyboard'" do
    Animoto::Resources::Storyboard.content_type.should == 'storyboard'
  end
  
  it "should have payload key 'storyboard'" do
    Animoto::Resources::Storyboard.payload_key.should == 'storyboard'
  end

  describe "initialization" do
    before do
      @body = {
        'response' => {
          'status' => {
            'code' => 200
          },
          'payload' => {
            'storyboard' => {
              'metadata' => {
                'duration' => 300.0,
                'visuals_count' => 60
              },
              'links' => {
                'self' => 'https://platform.animoto.com/storyboards/1',
                'preview' => 'http://storage.com/previews/1.mp4'
              }
            }
          }
        }
      }
      @storyboard = Animoto::Resources::Storyboard.load(@body)
    end
    
    it "should set its url from the 'self' link given" do
      @storyboard.url.should == 'https://platform.animoto.com/storyboards/1'
    end
    
    it "should set its preview url from the 'preview' link given" do
      @storyboard.preview_url.should == 'http://storage.com/previews/1.mp4'
    end
    
    it "should set its duration from the 'duration' metadata given" do
      @storyboard.duration.should == 300.0
    end
    
    it "should set its visuals count from the visuals_count metadata given" do
      @storyboard.visuals_count.should == 60
    end
  end
  
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
animoto-1.5.6 ./spec/animoto/resources/storyboard_spec.rb
animoto-1.5.5 ./spec/animoto/resources/storyboard_spec.rb
animoto-1.5.4 ./spec/animoto/resources/storyboard_spec.rb
animoto-1.5.3 ./spec/animoto/resources/storyboard_spec.rb
animoto-1.5.2 ./spec/animoto/resources/storyboard_spec.rb
animoto-1.5.1 ./spec/animoto/resources/storyboard_spec.rb
animoto-1.5.0 ./spec/animoto/resources/storyboard_spec.rb
animoto-1.3.1 ./spec/animoto/resources/storyboard_spec.rb
animoto-1.3.0 ./spec/animoto/resources/storyboard_spec.rb
animoto-1.2.0 ./spec/animoto/resources/storyboard_spec.rb