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
10 it "should have a size" do
11 @image = Mart::Image.new
12 @image.should_not be_valid
15 @image.should be_valid
18 it "should provide an extension" do
19 @image = Mart::Image.new
20 @image.filename = "fish.jpg"
21 @image.extension.should == "jpg"
23 @image.filename = "document.html.erb"
24 @image.extension.should == "erb"
25 @image.extension.should_not == "html"
28 it "should provide a filename without extension" do
29 @image = Mart::Image.new
30 @image.filename = "fish.jpg"
31 @image.filename_without_ext.should == "fish"
34 it "should provide a relative path" do
35 @image = Mart::Image.new
36 @image.filename = "a_dogs_life.gif"
37 @image.relative_path.should == "a_dogs_life.gif"