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 ...@@ -74,9 +74,14 @@ describe LikesController, :type => :controller do
end end
context "when an the exception is raised" do 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 it "should be catched when it means that the target is not found" do
allow(@target).to receive(:id).and_return(-1) params = like_hash.merge(format: :json, id_field => -1)
post :create, like_hash.merge(:format => :json) post :create, params
expect(response.code).to eq('422') expect(response.code).to eq('422')
end end
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter