Permalink
Browse files

Use the Users' full names in the link_to_profile helper. Closes #37

  • Loading branch information...
1 parent f928fe0 commit 7d5bd1a25b15d468751109529af5dfde274f8b73 @jeffkreeftmeijer jeffkreeftmeijer committed Oct 10, 2011
@@ -8,8 +8,8 @@ def avatar_url
def link_to_profile(user)
link_text = image_tag(user.gravatar_url(:size => 20, :default => avatar_url), :class => 'gravatar')
- link_text << " " << user.login
- link_to link_text, user_path(user), :name => user.login
+ link_text << " " << user.name
+ link_to link_text, user_path(user), :name => user.name
end
def clean_url(url)
@@ -88,7 +88,7 @@
end
scenario 'see the contest submitter' do
- page.should have_link 'bob'
+ page.should have_link 'Bob'
body.should include 'href="/users/bob"'
body.should include 'avatar/1dae832a3c5ae2702f34ed50a40010e8.png'
end
@@ -5,7 +5,7 @@
scenario 'log in via Github' do
visit '/'
click_link 'log in via Github'
- page.should have_content 'charlie'
+ page.should have_content 'Charlie'
end
scenario 'fail to log in using invalid credentials' do
@@ -3,7 +3,11 @@
describe ApplicationHelper do
describe "link_to_profile" do
before :each do
- @user = stub(:login => 'charlie', :to_param => 'charlie', :gravatar_url => 'http://gravatar.org/profile.png')
+ @user = stub(
+ :name => 'Charlie',
+ :to_param => 'charlie',
+ :gravatar_url => 'http://gravatar.org/profile.png'
+ )
end
let(:output) { helper.link_to_profile(@user) }
@@ -14,7 +18,7 @@
end
it "should include the username" do
- output.should include("charlie")
+ output.should include("Charlie")
end
it "should html escape the username" do

0 comments on commit 7d5bd1a

Please sign in to comment.