Sha256: bbee8b5176b72f9e1522f27d859bc9084e363f0fe73bec392ce3060f82fa52eb

Contents?: true

Size: 887 Bytes

Versions: 52

Compression:

Stored size: 887 Bytes

Contents

require 'spec_helper'

describe SpudUser do
  it { should have_many(:spud_admin_permissions) }

  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
end

Version data entries

52 entries across 52 versions & 2 rubygems

Version Path
spud_core-1.0.6 spec/models/spud_user_spec.rb
spud_core-1.0.5 spec/models/spud_user_spec.rb
spud_core-1.0.4 spec/models/spud_user_spec.rb
spud_core-1.0.3 spec/models/spud_user_spec.rb
spud_core-1.0.2 spec/models/spud_user_spec.rb
spud_core-1.0.1 spec/models/spud_user_spec.rb
spud_core-1.0.0 spec/models/spud_user_spec.rb
spud_core-1.0.0.rc2 spec/models/spud_user_spec.rb
spud_core-1.0.0.rc1.1 spec/models/spud_user_spec.rb
spud_core-1.0.0.rc1 spec/models/spud_user_spec.rb
spud_core-0.9.22 spec/models/spud_user_spec.rb
spud_core-0.9.21 spec/models/spud_user_spec.rb
spud_core-0.9.20 spec/models/spud_user_spec.rb
spud_core-0.9.19 spec/models/spud_user_spec.rb
tb_core-1.0.2 spec/models/spud_user_spec.rb
spud_core-0.9.18 spec/models/spud_user_spec.rb
tb_core-1.0.1 spec/models/spud_user_spec.rb
tb_core-1.0 spec/models/spud_user_spec.rb
tb_core-0.9.19 spec/models/spud_user_spec.rb
tb_core-0.9.18 spec/models/spud_user_spec.rb