diff --git a/app/views/shared/_group_nav.haml b/app/views/shared/_group_nav.haml index bd6af2ca2..281aa96c9 100644 --- a/app/views/shared/_group_nav.haml +++ b/app/views/shared/_group_nav.haml @@ -8,9 +8,10 @@ #add_group_pane.contextual_pane = render "groups/new_group" - #friend_pictures - - for friend in @group.people - = person_image_link(friend) + - if @group + #friend_pictures + - for friend in @group.people + = person_image_link(friend) #add_request_button.add_new = link_to "+", "#" diff --git a/lib/diaspora/webhooks.rb b/lib/diaspora/webhooks.rb index 423800459..fc26c5c95 100644 --- a/lib/diaspora/webhooks.rb +++ b/lib/diaspora/webhooks.rb @@ -39,7 +39,13 @@ module Diaspora end def people_with_permissions - self.person.owner.friends.all + begin + friends = self.person.owner.friends + friends ||= [] + rescue + Rails.logger.fatal("IOUASDVJOISDNVPOIJSDVOUIDSGPUOID") + [] + end end def self.build_xml_for(posts) diff --git a/spec/controllers/sockets_controller_spec.rb b/spec/controllers/sockets_controller_spec.rb index 6c4dac866..84188be25 100644 --- a/spec/controllers/sockets_controller_spec.rb +++ b/spec/controllers/sockets_controller_spec.rb @@ -13,28 +13,24 @@ describe 'SocketsController' do end it 'should unstub the websockets' do - WebSocket.initialize_channel + WebSocket.initialize_channels @controller.class.should == SocketsController end - it 'should add a new subscriber to the websockets channel' do - WebSocket.initialize_channel - @controller.new_subscriber.should == 1 - end describe 'actionhash' do before do @message = @user.post :status_message, :message => "post through user for victory" end it 'should actionhash posts' do - json = @controller.action_hash(@message) + json = @controller.action_hash(@user.id, @message) json.include?(@message.message).should be_true json.include?('status_message').should be_true end it 'should actionhash retractions' do retraction = Retraction.for @message - json = @controller.action_hash(retraction) + json = @controller.action_hash(@user.id, retraction) json.include?('retraction').should be_true json.include?("html\":null").should be_true end diff --git a/spec/models/comments_spec.rb b/spec/models/comments_spec.rb index 7418cd4bb..810b6dfc5 100644 --- a/spec/models/comments_spec.rb +++ b/spec/models/comments_spec.rb @@ -45,7 +45,7 @@ describe Comment do end it 'should send a user comment on his own post to lots of people' do - allowed_urls = @user_status.people_with_permissions.map!{|x| x = x.url + "receive/"} + allowed_urls = @user_status.people_with_permissions.map{|x| x = x.url + "receive/"} message_queue.should_receive(:add_post_request).with(allowed_urls, anything) @user.comment "yo", :on => @user_status end diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index c03e2c61c..f013e1583 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -25,8 +25,8 @@ describe Post do (5..8).each { |n| Blog.create(:title => "title #{n}",:body => "test #{n}", :person => @user.person)} (9..11).each { |n| Blog.create(:title => "title #{n}",:body => "test #{n}", :person => @person_two)} - Factory.create(:status_message) - Factory.create(:bookmark) + Factory.create(:status_message, :person => @user) + Factory.create(:bookmark, :person => @user) end it "should give the most recent blog title and body from owner" do