Skip to content

Commit

Permalink
added spec for checking destroy when title does not match
Browse files Browse the repository at this point in the history
  • Loading branch information
rishijain committed Oct 10, 2023
1 parent 18b719f commit fad9c88
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/controllers/projects_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fad9c88

Please sign in to comment.