diff --git a/app/helpers/sockets_helper.rb b/app/helpers/sockets_helper.rb index bea9aea94..43aa91b70 100644 --- a/app/helpers/sockets_helper.rb +++ b/app/helpers/sockets_helper.rb @@ -70,8 +70,7 @@ module SocketsHelper post = object.post action_hash[:comment_id] = object.id action_hash[:my_post?] = (post.person.owner_id == uid) - action_hash[:notification] = notification(object) - action_hash[:post_guid] = post.id + action_hash[:post_guid] = post.guid end diff --git a/app/models/user.rb b/app/models/user.rb index 9900896f5..650071746 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -265,7 +265,7 @@ class User < ActiveRecord::Base params[:image_url_small] = photo.url(:thumb_small) end if self.person.profile.update_attributes(params) - push_to_people profile, contact_people + push_to_people profile, self.contacts.includes(:person).map{|c| c.person} true else false diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index b7e8f385f..399cbc812 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -69,7 +69,7 @@ describe AspectsController do end it "assigns contacts to only non-pending" do @user.contacts.count.should == 1 - @user.send_contact_request_to(make_user.person, @aspect) + @user.send_contact_request_to(Factory(:user).person, @aspect) @user.contacts.count.should == 2 get :show, 'id' => @aspect.id.to_s @@ -128,7 +128,7 @@ describe AspectsController do end it "assigns contacts to only non-pending" do @user.contacts.count.should == 1 - @user.send_contact_request_to(make_user.person, @aspect) + @user.send_contact_request_to(Factory(:user).person, @aspect) @user.contacts.count.should == 2 get :manage diff --git a/spec/factories.rb b/spec/factories.rb index dc087c475..3b32a134b 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -40,7 +40,7 @@ Factory.define :user do |u| user.person = Factory.build(:person, :profile => Factory.create(:profile), :owner_id => user.id, :serialized_public_key => user.encryption_key.public_key.export, - :diaspora_handle => "#{user.username}@#{APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '').chop!}") + :diaspora_handle => "#{user.username}@#{AppConfig[:pod_url].gsub(/(https?:|www\.)\/\//, '').chop!}") end end diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb index a45d25d56..c83097e6c 100644 --- a/spec/models/notification_spec.rb +++ b/spec/models/notification_spec.rb @@ -58,9 +58,9 @@ describe Notification do end it 'sockets to the recipient' do - request = Request.instantiate(:from => @user.person, :to => @user2.person, :into => @aspect) + request = Request.diaspora_initialize(:from => @user.person, :to => @user2.person, :into => @aspect) opts = {:target_id => request.id, - :kind => request.notification_type(@user, @person), + :target_type => request.notification_type(@user, @person), :person_id => @person.id, :user_id => @user.id} diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 8a81c44ce..a41f80786 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -265,7 +265,7 @@ describe User do it "only pushes to non-pending contacts" do connect_users(user, aspect, user2, aspect2) user.contacts.count.should == 1 - user.send_contact_request_to(make_user.person, aspect) + user.send_contact_request_to(Factory(:user).person, aspect) user.contacts.count.should == 2 user.should_receive(:push_to_person).once @@ -300,7 +300,7 @@ describe User do context 'aspects' do it 'should delete an empty aspect' do user.drop_aspect(aspect) - user.aspects.include?(aspect).should == false + user.aspects(true).include?(aspect).should == false end it 'should not delete an aspect with contacts' do