From abd4e17daf2543a07b2a97e1c5868056b41cfcf4 Mon Sep 17 00:00:00 2001 From: Bobby Wilson Date: Thu, 22 Nov 2012 13:00:47 -0700 Subject: [PATCH] Fix #3750 --- app/helpers/people_helper.rb | 6 ++++-- app/views/people/_sub_header.html.haml | 2 +- spec/helpers/people_helper_spec.rb | 15 ++++++++++----- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb index f40bc0821..ef751f1c5 100644 --- a/app/helpers/people_helper.rb +++ b/app/helpers/people_helper.rb @@ -39,8 +39,10 @@ module PeopleHelper " @person) - last_post_link(@person).should include last_post_person_path(@person.to_param) + last_visible_post_for(@person).should be_blank + end + + it "shows the link, if the person has at least one visible post" do + post = FactoryGirl.create(:status_message, :author => @person, :public => true) + last_visible_post_for(@person).should include last_post_person_path(@person.to_param) end end