Skip to content
Extraits de code Groupes Projets
Valider ed446896 rédigé par Jonne Haß's avatar Jonne Haß
Parcourir les fichiers

Fix a spec for LikesController

parent 99ea156e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -74,9 +74,14 @@ describe LikesController, :type => :controller do
end
context "when an the exception is raised" do
before do
@target = alice.post :status_message, :text => "AWESOME", :to => @alices_aspect.id
@target = alice.comment!(@target, "hey") if class_const == Comment
end
it "should be catched when it means that the target is not found" do
allow(@target).to receive(:id).and_return(-1)
post :create, like_hash.merge(:format => :json)
params = like_hash.merge(format: :json, id_field => -1)
post :create, params
expect(response.code).to eq('422')
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