Commit f83032b76e818cf8221262170c8913145cdd2f91
Committed by
Daniela Feitosa
1 parent
c52de943
Exists in
master
and in
28 other branches
Don't show news tab on organizations private profiles if not member
(ActionItem1847)
Showing
2 changed files
with
14 additions
and
1 deletions
Show diff stats
app/views/profile/_profile.rhtml
... | ... | @@ -10,7 +10,9 @@ |
10 | 10 | <% end %> |
11 | 11 | |
12 | 12 | <% if @profile.organization? %> |
13 | - <% tabs << {:title => _('What\'s new'), :id => 'profile-network', :content => (render :partial => 'profile_network')} %> | |
13 | + <% if @profile.public? || (logged_in? && current_person.follows?(@profile)) %> | |
14 | + <% tabs << {:title => _('What\'s new'), :id => 'profile-network', :content => (render :partial => 'profile_network')} %> | |
15 | + <% end %> | |
14 | 16 | <% tabs << {:title => _('Profile'), :id => 'organization-profile', :content => (render :partial => 'organization_profile')} %> |
15 | 17 | <% elsif @profile.person? %> |
16 | 18 | <% if logged_in? && current_person.follows?(@profile) %> | ... | ... |
features/private_profile.feature
... | ... | @@ -29,3 +29,14 @@ Feature: private profiles |
29 | 29 | And I follow "Add friend" |
30 | 30 | When I go to shygirl's homepage |
31 | 31 | Then I should not see "Add friend" |
32 | + | |
33 | + Scenario: viewing a private community profile shouldn't show the news if not logged or not a member | |
34 | + Given I am on Safernet's homepage | |
35 | + Then I should not see "What's new" | |
36 | + And I am logged in as "joao" | |
37 | + When I am on Safernet's homepage | |
38 | + Then I should not see "What's new" | |
39 | + And "joao" is a member of "Safernet" | |
40 | + When I am on Safernet's homepage | |
41 | + Then I should see "What's new" | |
42 | + | ... | ... |