Added validations available in dm-validations.
[merb_mart.git] / spec / models / order_user_spec.rb
blobf94bec5f038e40edd7a668b0441f43eacc260a81
1 require File.join( File.dirname(__FILE__), "..", "spec_helper" )
3 describe OrderUser do
5   describe "associations" do
7     it "should have orders"
8     it "should have one last order"
9     it "should have many addresses"
10     it "should have many accounts"
11   
12     it "should have wishlist items"
13     it "should have items" # ??
14   
15   end
17   describe "email address" do
19     it "should require an email address" do
20       order_user = OrderUser.new
21       order_user.valid?
22       order_user.errors.on(:email).should_not be_nil
23     end
24   
25     it "should require an email address to be less than least 255"
26     it "should require an email address to be unique"
27     it "should require a valid email address"
28   
29   end
30   
31   it "should have an authenticate method"
32   
33   it "should generate a random password" do
34     password = OrderUser.generate_password
35     password.should_not be_nil
36     password.length.should == 8
37   end
38   
39   it "should generate a random password of 15 characters" do
40     password = OrderUser.generate_password(15)
41     password.should_not be_nil
42     password.length.should == 15
43   end
44   
45   it "should provide the last billing address"
46   it "should provide the last shipping address"
47   it "should provide the last order account"
48   
49   it "should have a reset_password method"
50   it "should have an add_item_to_wishlist method"
51   it "should have a remove_item_from_wishlist method"
53 end