1 require File.join( File.dirname(__FILE__), "..", "..", "spec_helper" )
3 describe Mart::Customer do
5 describe "associations" do
8 @customer = Mart::Customer.new
11 it "should have many (0..*) orders" do
12 @customer.should respond_to(:orders)
15 it "should have many (0..*) addresses" do
16 @customer.should respond_to(:addresses)
19 it "should have many (0..*) accounts" do
20 @customer.should respond_to(:accounts)
23 it "should have many (0..*) wishlist items" do
24 @customer.should respond_to(:wishlist_items)
27 it "should have items" # ??
31 describe "email address" do
33 it "should require an email address" do
34 customer = Mart::Customer.new
36 customer.errors.on(:email_address).should_not be_nil
39 it "should require an email address to be less than least 255"
40 it "should require an email address to be unique"
41 it "should require a valid email address"
45 it "should have an authenticate method"
47 #it "should generate a random password" do
48 # password = Customer.generate_password
49 # password.should_not be_nil
50 # password.length.should == 8
53 #it "should generate a random password of 15 characters" do
54 # password = Customer.generate_password(15)
55 # password.should_not be_nil
56 # password.length.should == 15
59 it "should provide the last billing address"
60 it "should provide the last shipping address"
61 it "should provide the last order account"
64 #it "should have a reset_password method"
65 #it "should have an add_item_to_wishlist method"
66 #it "should have a remove_item_from_wishlist method"
69 it "should have one last order"