From 2b97f740152233c874997d49cdb143f8b0b8aedd Mon Sep 17 00:00:00 2001 From: movilla Date: Thu, 29 Aug 2013 12:18:53 +0200 Subject: [PATCH] error 500 when visit probile mobile and logged out. Fix #4458 --- Changelog.md | 1 + app/views/shared/_post_info.mobile.haml | 2 +- features/mobile/logged_out_browsing.feature | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 features/mobile/logged_out_browsing.feature diff --git a/Changelog.md b/Changelog.md index d34696f34..cd30af6a1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -7,6 +7,7 @@ * Highlight down arrow at the user menu on hover [#4441](https://github.com/diaspora/diaspora/pull/4441) * Make invite code input width consistent across borwsers [#4448](https://github.com/diaspora/diaspora/pull/4448) * Fix style of contacts in profile sidebar [#4451](https://github.com/diaspora/pull/4451) +* Fix profile mobile when logged out [#4464](https://github.com/diaspora/pull/4464) ## Features * Add oEmbed content to the mobile view [#4343](https://github.com/diaspora/diaspora/pull/4353) diff --git a/app/views/shared/_post_info.mobile.haml b/app/views/shared/_post_info.mobile.haml index dce2721be..893810cf4 100644 --- a/app/views/shared/_post_info.mobile.haml +++ b/app/views/shared/_post_info.mobile.haml @@ -7,7 +7,7 @@ = person_link(post.author) .remove_post - - if post.author == current_user.person + - if user_signed_in? && post.author == current_user.person = link_to(image_tag('deletelabel.png'), post_path(post), :method => :delete, :data => { :confirm => "#{t('are_you_sure')}" }, :class => "remove") .info diff --git a/features/mobile/logged_out_browsing.feature b/features/mobile/logged_out_browsing.feature new file mode 100644 index 000000000..f63314444 --- /dev/null +++ b/features/mobile/logged_out_browsing.feature @@ -0,0 +1,15 @@ +@javascript +Feature: Browsing Diaspora as a logged out user mobile + In order to view public diaspora content + as a random internet user + I want to view public pages + + Background: + Given a user named "Bob Jones" with email "bob@bob.bob" + And "bob@bob.bob" has a public post with text "public stuff" + And I log out + + Scenario: Visiting a profile page + When I toggle the mobile view + And I am on "bob@bob.bob"'s page + Then I should see "public stuff"