Permalink
Browse files

Test for should delete

  • Loading branch information...
1 parent 674b3ab commit acaf5cf3f597c75ccaba801fdcff3eadda6641e9 @felixclack felixclack committed Mar 6, 2010
Showing with 13 additions and 0 deletions.
  1. +6 −0 test/functional/users_controller_test.rb
  2. +7 −0 test/test-app/app/controllers/users_controller.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
@@ -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

0 comments on commit acaf5cf

Please sign in to comment.