Mostly fix PeopleController#show for mobile

This commit is contained in:
Raphael Sofaer 2011-04-08 10:27:52 -07:00
parent f194166841
commit 761411e153
2 changed files with 24 additions and 5 deletions

View file

@ -33,16 +33,14 @@
= link_to t('.return_to_aspects'), aspects_manage_path
= t('.to_accept_or_ignore')
- if @posts.count > 0
- if @posts.length > 0
-if @post_type == :photos
= render 'photos/index', :photos => @posts
- else
#main_stream.stream
= render 'shared/stream', :posts => @posts
%a.paginate
= t("more")
= will_paginate @posts
#pagination
=link_to(t('more'), person_path(@person, :page => next_page), :class => 'paginate')
- else
#stream
%li{:style=>"text-align:center;"}

View file

@ -111,6 +111,11 @@ describe PeopleController do
response.should be_success
end
it 'succeeds on the mobile site' do
get :show, :id => @user.person.to_param, :format => :mobile
response.should be_success
end
it "assigns the right person" do
get :show, :id => @user.person.to_param
assigns(:person).should == @user.person
@ -143,6 +148,12 @@ describe PeopleController do
get :show, :id => @person.id
response.status.should == 200
end
it 'succeeds on the mobile site' do
get :show, :id => @person.id, :format => :mobile
response.should be_success
end
it "assigns only public posts" do
public_posts = []
public_posts << bob.post(:status_message, :text => "first public ", :to => bob.aspects[0].id, :public => true)
@ -172,6 +183,11 @@ describe PeopleController do
response.should be_success
end
it 'succeeds on the mobile site' do
get :show, :id => @person.id, :format => :mobile
response.should be_success
end
it "assigns only the posts the current user can see" do
bob.posts.should be_empty
posts_user_can_see = []
@ -196,6 +212,11 @@ describe PeopleController do
response.should be_success
end
it 'succeeds on the mobile site' do
get :show, :id => @person.id, :format => :mobile
response.should be_success
end
it "assigns only public posts" do
eve.posts.should be_empty
eve.post(:status_message, :text => "to an aspect @user is not in", :to => eve.aspects.first.id)