Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test for should delete

  • Loading branch information...
commit acaf5cf3f597c75ccaba801fdcff3eadda6641e9 1 parent 674b3ab
@felixclack felixclack authored
View
6 test/functional/users_controller_test.rb
@@ -47,6 +47,12 @@ class UsersControllerTest < ActionController::TestCase
should_not :create => User
assigned(User).name.should_be "demo"
end
+
+ context "deleting the user" do
+ before { delete :destroy, :id => @user.to_param }
+
+ should :delete => User
+ end
end
private
View
7 test/test-app/app/controllers/users_controller.rb
@@ -30,4 +30,11 @@ def update
redirect_to users_url
end
+
+ def destroy
+ @user = User.find(params[:id])
+
+ @user.destroy
+ redirect_to users_url
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.