Skip to content
Extraits de code Groupes Projets
Valider 67100aa7 rédigé par Dan Hansen's avatar Dan Hansen
Parcourir les fichiers

fix the build

parent 225e5fc9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -6,7 +6,7 @@ class AspectsController < ApplicationController
before_filter :authenticate_user!
respond_to :html
respond_to :json, :only => [:show, :move_contact]
respond_to :json, :only => :show
respond_to :js
def index
......@@ -113,21 +113,20 @@ class AspectsController < ApplicationController
@from_aspect = current_user.aspects.where(:id => params[:from]).first
@to_aspect = current_user.aspects.where(:id => params[:to][:to]).first
response = { }
response_hash = { }
unless current_user.move_contact( @person, @to_aspect, @from_aspect)
flash[:error] = I18n.t 'aspects.move_contact.error',:inspect => params.inspect
end
if aspect = current_user.aspects.where(:id => params[:to][:to]).first
response[:notice] = I18n.t 'aspects.move_contact.success'
response[:success] = true
response_hash[:notice] = I18n.t 'aspects.move_contact.success'
response_hash[:success] = true
else
response[:notice] = I18n.t 'aspects.move_contact.failure'
response[:success] = false
response_hash[:notice] = I18n.t 'aspects.move_contact.failure'
response_hash[:success] = false
end
respond_with response
render :text => response_hash.to_json
end
def add_to_aspect
......
......@@ -210,13 +210,13 @@ describe AspectsController do
:person_id => @person.id,
:from => @aspect0.id,
:to =>
{:to => @aspect1.id}
{:to => @aspect1.id},
}
end
it 'calls the move_contact_method' do
@controller.stub!(:current_user).and_return(@user)
@user.should_receive(:move_contact)
post :move_contact, @opts
post "move_contact", @opts
end
end
......
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