From fad9c8839e21ca69ac6ea7d0e44bfd7bd4d3b6c3 Mon Sep 17 00:00:00 2001 From: rishijain Date: Tue, 10 Oct 2023 12:35:58 +0700 Subject: [PATCH] added spec for checking destroy when title does not match --- spec/controllers/projects_controller_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/controllers/projects_controller_spec.rb b/spec/controllers/projects_controller_spec.rb index c2b8d54e..ca1a0e4e 100644 --- a/spec/controllers/projects_controller_spec.rb +++ b/spec/controllers/projects_controller_spec.rb @@ -147,6 +147,12 @@ delete :destroy, params: {id: project.id} }.not_to change(Project, :count) end + + it "does not delete the project when the title does not match" do + expect { + delete :destroy, params: {id: project.id, project: {title: "random title"}} + }.not_to change(Project, :count) + end end describe "#show" do