Sha256: 6a9cbfac93c1777da7c5a7dbec251167c4c8db8fcd404ec3fd2a7c0fa33aa150

Contents?: true

Size: 787 Bytes

Versions: 2

Compression:

Stored size: 787 Bytes

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe Person do
  before(:each) do
    @person = Person.new(:first_name => 'Jim', :last_name => 'Gay', :middle_name => 'M')
  end

  describe "full_name" do
    it "should return the concatenated first, middle, and last names" do
      @person.full_name.should == 'Jim M Gay'
    end
    it "should return the concatenated names stripped of extra whitespace" do
      @person.first_name = '  Jim'
      @person.last_name = 'Gay   '
      @person.middle_name = ''
      @person.full_name.should == 'Jim Gay'
    end
    context 'with :last_name_first' do
      it "should return the concatenated last, first, and middle names" do
        @person.full_name(:last_name_first => true).should == 'Gay, Jim M'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
radiant-people-extension-1.1.0 spec/models/person_spec.rb
radiant-people-extension-1.0.0 spec/models/person_spec.rb