Sha256: 1c48a1a71531a86ac5ac38df0d37647c06dce25c05cf675ffdb1406bea24f6b9

Contents?: true

Size: 1.12 KB

Versions: 5

Compression:

Stored size: 1.12 KB

Contents

require File.join(File.dirname(__FILE__), "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

5 entries across 5 versions & 1 rubygems

Version Path
vj-sdk-0.8.0.1 spec/asset_spec.rb
vj-sdk-0.7.14 spec/asset_spec.rb
vj-sdk-0.7.13 spec/asset_spec.rb
vj-sdk-0.7.11 spec/asset_spec.rb
vj-sdk-0.7.10 spec/asset_spec.rb