diff --git a/app/models/photo.rb b/app/models/photo.rb index 46f3b3c64..549402b0b 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -41,7 +41,6 @@ class Photo < Post end def remote_photo= remote_path - pp remote_path name_start = remote_path.rindex '/' self.remote_photo_path = remote_path.slice(0, name_start ) self.remote_photo_name = remote_path.slice(name_start + 1, remote_path.length) diff --git a/app/models/user.rb b/app/models/user.rb index 650071746..aeced510c 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, self.contacts.includes(:person).map{|c| c.person} + push_to_people profile, self.contacts(:pending => false).includes(:person).map{|c| c.person} true else false diff --git a/spec/controllers/requests_controller_spec.rb b/spec/controllers/requests_controller_spec.rb index fe74f62d9..e590fffbd 100644 --- a/spec/controllers/requests_controller_spec.rb +++ b/spec/controllers/requests_controller_spec.rb @@ -31,7 +31,7 @@ describe RequestsController do :accept => "true", :aspect_id => @user.aspects.first.id.to_s, :id => @friend_request.id.to_s - response.should redirect_to(aspect_path(@user.aspects.first)) + response.should redirect_to(requests_path) end end describe 'when ignoring a contact request' do diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb index c83097e6c..b8dffc9c1 100644 --- a/spec/models/notification_spec.rb +++ b/spec/models/notification_spec.rb @@ -38,7 +38,7 @@ describe Notification do Notification.create(@opts) end - @opts.delete(:user_id) + @opts.delete(:recipient_id) Notification.create(@opts.merge(:recipient_id => user2.id)) Notification.for(@user).count.should == 4 @@ -61,8 +61,8 @@ describe Notification do request = Request.diaspora_initialize(:from => @user.person, :to => @user2.person, :into => @aspect) opts = {:target_id => request.id, :target_type => request.notification_type(@user, @person), - :person_id => @person.id, - :user_id => @user.id} + :actor_id => @person.id, + :recipient_id => @user.id} n = Notification.create(opts) Notification.stub!(:create).and_return n diff --git a/spec/models/user/connecting_spec.rb b/spec/models/user/connecting_spec.rb index 9dcccc2a0..de936e4aa 100644 --- a/spec/models/user/connecting_spec.rb +++ b/spec/models/user/connecting_spec.rb @@ -111,7 +111,7 @@ describe Diaspora::UserModules::Connecting do Notification.where(:target_id=>@received_request.id).first.unread.should be_true user.accept_contact_request(@received_request, aspect) - Notification.first(:target_id=>@received_request.id).unread.should be_false + Notification.where(:target_id=>@received_request.id).first.unread.should be_false end it 'should be able to ignore a pending contact request' do proc { user.ignore_contact_request(@received_request.id)