Fix PeopleController#show mobile
This commit is contained in:
parent
761411e153
commit
f8359bd77d
3 changed files with 12 additions and 2 deletions
|
|
@ -87,7 +87,7 @@ class PeopleController < ApplicationController
|
||||||
@contacts_of_contact = []
|
@contacts_of_contact = []
|
||||||
end
|
end
|
||||||
|
|
||||||
if (@person != current_user.person) && (!@contact || @contact.pending)
|
if (@person != current_user.person) && (!@contact || !@contact.persisted? || @contact.pending)
|
||||||
@commenting_disabled = true
|
@commenting_disabled = true
|
||||||
else
|
else
|
||||||
@commenting_disabled = false
|
@commenting_disabled = false
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
- if user_signed_in? && !(@contact.persisted? || current_user.person == @person)
|
- if user_signed_in? && !(@contact.persisted? || current_user.person == @person)
|
||||||
.right
|
.right
|
||||||
= link_to "start sharing",
|
= link_to "start sharing",
|
||||||
{:controller => "contact",
|
{:controller => "contacts",
|
||||||
:action => "new",
|
:action => "new",
|
||||||
:id => @person.id},
|
:id => @person.id},
|
||||||
:class => 'share_with button',
|
:class => 'share_with button',
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,11 @@ describe PeopleController do
|
||||||
get :show, :id => @person.id
|
get :show, :id => @person.id
|
||||||
assigns(:posts).models.should =~ posts_user_can_see
|
assigns(:posts).models.should =~ posts_user_can_see
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'sets @commenting_disabled to true' do
|
||||||
|
get :show, :id => @person.id
|
||||||
|
assigns(:commenting_disabled).should == false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "when the person is not a contact of the current user" do
|
context "when the person is not a contact of the current user" do
|
||||||
|
|
@ -227,6 +232,11 @@ describe PeopleController do
|
||||||
get :show, :id => @person.id
|
get :show, :id => @person.id
|
||||||
assigns[:posts].models.should =~ [public_post]
|
assigns[:posts].models.should =~ [public_post]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'sets @commenting_disabled to true' do
|
||||||
|
get :show, :id => @person.id
|
||||||
|
assigns(:commenting_disabled).should == true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue