fix the build
This commit is contained in:
parent
225e5fc9d7
commit
67100aa7bb
2 changed files with 9 additions and 10 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue