Skip to content

Commit

Permalink
Rename method.
Browse files Browse the repository at this point in the history
  • Loading branch information
johno committed Jan 30, 2014
1 parent 6ae27c6 commit 243adcd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion app/decorators/user_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ def full_name
"#{ first_name } #{ last_name }".strip
end
end
alias_method :fullname, :full_name

def joined_at
created_at.strftime("%B %Y")
Expand Down
6 changes: 3 additions & 3 deletions spec/decorators/user_decorator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
before { user.first_name = '' }

it 'should return the last name' do
expect(decorator.fullname).to eq(last_name)
expect(decorator.full_name).to eq(last_name)
end
end

context 'with a first and last name' do

it 'should return the full name' do
expect(decorator.fullname).to eq("#{ first_name } #{ last_name }")
expect(decorator.full_name).to eq("#{ first_name } #{ last_name }")
end
end

Expand All @@ -34,7 +34,7 @@
end

it 'should return no name provided' do
expect(decorator.fullname).to eq('No name provided.')
expect(decorator.full_name).to eq('No name provided.')
end
end
end
Expand Down

0 comments on commit 243adcd

Please sign in to comment.