diff options
author | Maxwell Salzberg <maxwell@joindiaspora.com> | 2011-05-26 04:22:36 +0400 |
---|---|---|
committer | Raphael Sofaer <raphael@joindiaspora.com> | 2011-07-22 05:22:17 +0400 |
commit | 06f886ad770d95b7396a068ad15c153c624632d9 (patch) | |
tree | 5fd3f8170d4a0a7b39d1709164d83ec8007f9253 /spec | |
parent | bf59bf1c726d611af600cc1b6735e1122db71694 (diff) |
WIP reshare
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/people_controller_spec.rb | 19 | ||||
-rw-r--r-- | spec/factories.rb | 5 |
2 files changed, 24 insertions, 0 deletions
diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index 7bb2b4d95..f6aea6246 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -137,6 +137,7 @@ describe PeopleController do response.body.match(profile.first_name).should be_false end + context "when the person is the current user" do it "succeeds" do get :show, :id => @user.person.to_param @@ -204,6 +205,12 @@ describe PeopleController do @public_posts.first.save end + it "posts include reshares" do + reshare = @user.post(:reshare, :public => true, :root_id => Factory(:status_message, :public => true).id) + get :show, :id => @user.person.id + assigns[:posts].post_fakes.map{|x| x.id}.should include(reshare.id) + end + it "assigns only public posts" do get :show, :id => @person.id assigns[:posts].models.should =~ @public_posts @@ -251,6 +258,12 @@ describe PeopleController do assigns(:posts).models.should =~ posts_user_can_see end + it "posts include reshares" do + reshare = @user.post(:reshare, :public => true, :root_id => Factory(:status_message, :public => true).id) + get :show, :id => @user.person.id + assigns[:posts].post_fakes.map{|x| x.id}.should include(reshare.id) + end + it 'sets @commenting_disabled to true' do get :show, :id => @person.id assigns(:commenting_disabled).should == false @@ -283,6 +296,12 @@ describe PeopleController do assigns[:posts].models.should =~ [public_post] end + it "posts include reshares" do + reshare = @user.post(:reshare, :public => true, :root_id => Factory(:status_message, :public => true).id) + get :show, :id => @user.person.id + assigns[:posts].post_fakes.map{|x| x.id}.should include(reshare.id) + end + it 'sets @commenting_disabled to true' do get :show, :id => @person.id assigns(:commenting_disabled).should == true diff --git a/spec/factories.rb b/spec/factories.rb index 7d9ebe9ca..dbd6da864 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -91,6 +91,11 @@ Factory.define(:photo) do |p| end end +Factory.define :reshare do |r| + r.association(:root, :public => true, :factory => :status_message) + r.association(:author, :factory => :person) +end + Factory.define :service do |service| service.nickname "sirrobertking" service.type "Services::Twitter" |