Sha256: f4a228a50cccbb5f9e815d008cf4084909d059b270a32c8d672df47e00a9d3fd
Contents?: true
Size: 1.31 KB
Versions: 16
Compression:
Stored size: 1.31 KB
Contents
require 'spec_helper' describe SpudUser do describe ".full_name" do it "should return the full name if the first and last name are not blank" do u = FactoryGirl.build(:spud_user) u.full_name.should == "#{u.first_name} #{u.last_name}" end it "should return only the last name if the first name is blank" do u = FactoryGirl.build(:spud_user, :first_name => nil) u.full_name.should == u.last_name end it "should return only the first name if the last name is blank" do u = FactoryGirl.build(:spud_user, :last_name => nil) u.full_name.should == u.first_name end it "should return the login if the first and last name are blank" do u = FactoryGirl.build(:spud_user, :first_name => nil, :last_name => nil) u.full_name.should == u.login end end it { should_not allow_value('').for(:login) } it { should ensure_length_of(:login).is_at_least(3) } it { should ensure_length_of(:password).is_at_least(4) } it { should_not allow_value('@mail.com').for(:email) } it { should_not allow_value('mail.com').for(:email) } it { should allow_value('test@mail.com').for(:email) } it "must match password confirmation before saving a new user" do u = FactoryGirl.build(:spud_user, :password_confirmation => '') u.save.should == false end end
Version data entries
16 entries across 16 versions & 1 rubygems