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