fix aspect_memberships_controller specs

This commit is contained in:
danielgrippi 2011-03-30 11:09:41 -07:00
parent cd3a307785
commit c4295a7693
2 changed files with 6 additions and 5 deletions

View file

@ -67,7 +67,7 @@ class AspectMembershipsController < ApplicationController
def update
@person = Person.find(params[:person_id])
@from_aspect = current_user.aspects.where(:id => params[:id]).first
@from_aspect = current_user.aspects.where(:id => params[:aspect_id]).first
@to_aspect = current_user.aspects.where(:id => params[:to]).first
response_hash = { }

View file

@ -41,7 +41,7 @@ describe AspectMembershipsController do
delete :destroy,
:format => 'js', :id => 123,
:person_id => @user2.person.id,
:id => @aspect0.id
:aspect_id => @aspect0.id
response.should be_success
@aspect0.reload
@aspect0.contacts.include?(@contact).should be false
@ -51,8 +51,9 @@ describe AspectMembershipsController do
it 'calls the move_contact method' do
@controller.stub!(:current_user).and_return(@user)
@user.should_receive(:move_contact)
put :update, :person_id => @user.person.id,
:id => @aspect0.id,
put :update, :id => 123,
:person_id => @user.person.id,
:aspect_id => @aspect0.id,
:to => @aspect1.id
end
end
@ -81,7 +82,7 @@ describe AspectMembershipsController do
delete :destroy,
:format => 'js', :id => 123,
:person_id => @user2.person.id,
:id => @aspect0.id
:aspect_id => @aspect0.id
response.should_not be_success
response.body.should include "Cannot remove person from last aspect"
end