diaspora/spec/helpers/users_helper_spec.rb
2010-11-21 16:13:02 -08:00

19 lines
596 B
Ruby

# Copyright (c) 2010, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
require 'spec_helper'
describe UsersHelper do
describe '#first_name_or_username' do
let(:user){ make_user }
it 'should display the first name if it is set' do
first_name_or_username(user).should == user.person.profile.first_name
end
it 'should display the username if the first name is empty' do
user.person.profile.first_name = ""
first_name_or_username(user).should == user.username
end
end
end