1 require File.join( File.dirname(__FILE__), "..", "..", "spec_helper" )
3 describe Mart::Image do
5 #it "should have a filename" do
6 # @image = Mart::Image.new
7 # @image.should_not be_valid
11 @image = Mart::Image.new
14 it "should have a size" do
15 #@image.should_not be_valid
18 @image.should be_valid
21 it "should provide an extension" do
24 @image = Mart::Image.new
25 @image.filename = "fish.jpg"
26 @image.extension.should == "jpg"
28 @image.filename = "document.html.erb"
29 @image.extension.should == "erb"
30 @image.extension.should_not == "html"
33 it "should provide a filename without extension" do
34 @image.filename = "fish.jpg"
35 @image.filename_base.should == "fish"
38 it "should provide a relative path" do
39 @image.filename = "a_dogs_life.gif"
40 @image.relative_path.should == "a_dogs_life.gif"