Fix a couple more specs in mysql

This commit is contained in:
Raphael 2010-12-26 20:52:15 -08:00
parent 34b5566333
commit 5a1bd13831
5 changed files with 6 additions and 7 deletions

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)