Sha256: 7555396dda9fec419893b0d19d963849cbe2773f31b760fe22c8e1d2acb1d4a1

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

require "helpers/spec_helper"

describe Videojuicer::Asset do

  before :all do
    configure_test_settings
    
    @klass = Videojuicer::Asset
    @assets = @klass.types.map do |t|
      
      t.all.each { |a| a.destroy }
      
      10.of { t.gen } << t.gen(:friendly_name => "to_filter")
    end.flatten
  end
  
  after :all do
    begin
      @assets.each { |a| a.destroy }
    rescue
    end
  end
  
  describe "listing assets of all types" do
    it "should list all assets" do
      @assets = @klass.all
      @assets.class.should == Videojuicer::Resource::Collection
      @assets.total.should >= @assets.size
    end
    
    it "should limit results" do
      @assets = @klass.all(:limit => 5)
      @assets.length.should == 5
    end
    
    it "should paginate" do
      @assets = @klass.all(:limit => 10, :page => 2)
      @assets.page_count.should > 2
      @assets.page_number.should == 2
      @assets.length.should == 10
    end
    
    it "should filter by friendly_name" do
      @klass.all("friendly_name.like" => "to_filter").total.should == @klass.types.size
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vj-sdk-0.8.2 spec/asset_spec.rb