don't display a reshare link if the original post has been deleted
This commit is contained in:
parent
e11de0c7d0
commit
a78fa96e99
2 changed files with 11 additions and 1 deletions
|
|
@ -9,6 +9,7 @@ module ResharesHelper
|
|||
|
||||
def reshare_link(post)
|
||||
if reshare?(post)
|
||||
return unless post.root
|
||||
link_to t("reshares.reshare.reshare_original"),
|
||||
reshares_path(:root_guid => post.root.guid),
|
||||
:method => :post,
|
||||
|
|
|
|||
|
|
@ -11,5 +11,14 @@ require 'spec_helper'
|
|||
# end
|
||||
# end
|
||||
describe ResharesHelper do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
include StreamHelper
|
||||
|
||||
describe 'reshare_link' do
|
||||
it 'does not display a reshare for a post that does not exist' do
|
||||
reshare = Factory.build(:reshare, :root => nil)
|
||||
lambda {
|
||||
reshare_link(reshare)
|
||||
}.should_not raise_error
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue