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

fix aspect_memberships_controller specs

parent cd3a3077
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -67,7 +67,7 @@ class AspectMembershipsController < ApplicationController ...@@ -67,7 +67,7 @@ class AspectMembershipsController < ApplicationController
def update def update
@person = Person.find(params[:person_id]) @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 @to_aspect = current_user.aspects.where(:id => params[:to]).first
response_hash = { } response_hash = { }
......
...@@ -41,7 +41,7 @@ describe AspectMembershipsController do ...@@ -41,7 +41,7 @@ describe AspectMembershipsController do
delete :destroy, delete :destroy,
:format => 'js', :id => 123, :format => 'js', :id => 123,
:person_id => @user2.person.id, :person_id => @user2.person.id,
:id => @aspect0.id :aspect_id => @aspect0.id
response.should be_success response.should be_success
@aspect0.reload @aspect0.reload
@aspect0.contacts.include?(@contact).should be false @aspect0.contacts.include?(@contact).should be false
...@@ -51,8 +51,9 @@ describe AspectMembershipsController do ...@@ -51,8 +51,9 @@ describe AspectMembershipsController do
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)
put :update, :person_id => @user.person.id, put :update, :id => 123,
:id => @aspect0.id, :person_id => @user.person.id,
:aspect_id => @aspect0.id,
:to => @aspect1.id :to => @aspect1.id
end end
end end
...@@ -81,7 +82,7 @@ describe AspectMembershipsController do ...@@ -81,7 +82,7 @@ describe AspectMembershipsController do
delete :destroy, delete :destroy,
:format => 'js', :id => 123, :format => 'js', :id => 123,
:person_id => @user2.person.id, :person_id => @user2.person.id,
:id => @aspect0.id :aspect_id => @aspect0.id
response.should_not be_success response.should_not be_success
response.body.should include "Cannot remove person from last aspect" response.body.should include "Cannot remove person from last aspect"
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