1 require File.join( File.dirname(__FILE__), "..", "..", "spec_helper" )
3 describe Mart::Asset do
5 it "should have a filename" do
6 @asset = Mart::Asset.new
7 @asset.should_not be_valid
10 it "should have a size" do
11 @asset = Mart::Asset.new
12 @asset.should_not be_valid
15 @asset.should be_valid
18 it "should provide an extension" do
19 @asset = Mart::Asset.new
20 @asset.filename = "fish.jpg"
21 @asset.extension.should == "jpg"
23 @asset.filename = "document.html.erb"
24 @asset.extension.should == "erb"
25 @asset.extension.should_not == "html"
28 it "should provide a filename without extension" do
29 @asset = Mart::Asset.new
30 @asset.filename = "fish.jpg"
31 @asset.filename_without_ext.should == "fish"
34 it "should provide a relative path" do
35 @asset = Mart::Asset.new
36 @asset.filename = "a_dogs_life.html"
37 @asset.relative_path.should == "a_dogs_life.html"