Skip to content
Extraits de code Groupes Projets
Valider e881edab rédigé par Raphael's avatar Raphael
Parcourir les fichiers

Fix missing partials on last commit, you can now accept a request from the requestor's profile page

parent 3b727dc8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -116,6 +116,12 @@ class AspectsController < ApplicationController ...@@ -116,6 +116,12 @@ class AspectsController < ApplicationController
current_user.add_contact_to_aspect(@contact, @aspect) current_user.add_contact_to_aspect(@contact, @aspect)
else else
current_user.send_contact_request_to(@person, @aspect) current_user.send_contact_request_to(@person, @aspect)
contact = current_user.contact_for(@person)
if request = Request.from(@person).to(current_user).first
request.destroy
contact.update_attributes(:pending => false)
end
end end
flash.now[:notice] = I18n.t 'aspects.add_to_aspect.success' flash.now[:notice] = I18n.t 'aspects.add_to_aspect.success'
......
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
.contact_list#aspects_list
%ul
- for aspect in aspects_with_person
%li{:data=>{:guid=>aspect.id}}
%span.name
= link_to aspect.name, aspect
.right
= aspect_membership_button(aspect.id, contact, person)
- for aspect in aspects_without_person
%li{:data=>{:guid=>aspect.id}}
%span.name
= link_to aspect.name, aspect
.right
= aspect_membership_button(aspect.id, contact, person)
-# Copyright (c) 2010, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
#share_with
.share_with_header
= person_image_link(@person, :size => :thumb_medium)
%h3
= "Start sharing with #{@person.name}"
%p
= "Once #{@person.first_name} accepts, you'll start seeing each other's posts on Diaspora"
= render :partial => 'share_with_pane',
:locals => {:person => @person,
:contact => @contact,
:aspects_with_person => @aspects_with_person,
:aspects_without_person => @aspects_without_person}
...@@ -227,6 +227,27 @@ describe AspectsController do ...@@ -227,6 +227,27 @@ describe AspectsController do
end end
describe "#add_to_aspect" do describe "#add_to_aspect" do
context 'with an incoming request' do
before do
@user3 = make_user
@user3.send_contact_request_to(@user.person, @user3.aspects.create(:name => "Walruses"))
end
it 'deletes the request' do
post 'add_to_aspect',
:format => 'js',
:person_id => @user3.person.id,
:aspect_id => @aspect1.id
Request.from(@user3).to(@user).first.should be_nil
end
it 'does not leave the contact pending' do
post 'add_to_aspect',
:format => 'js',
:person_id => @user3.person.id,
:aspect_id => @aspect1.id
@user.contact_for(@user3.person).should_not be_pending
end
end
context 'with a non-contact' do context 'with a non-contact' do
before do before do
@person = Factory(:person) @person = Factory(:person)
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter