Permalink
Browse files

tests

  • Loading branch information...
1 parent f1f6bbf commit 6a0b949d69ded3d41797e0bc6297f6e3ff2d3b02 @bborn bborn committed Jun 18, 2011
View
9 test/functional/comments_controller_test.rb
@@ -80,6 +80,15 @@ def test_should_not_destroy_post_comment
end
end
+ def test_should_delete_selected
+ login_as :admin
+ assert_difference Comment, :count, -1 do
+ post :delete_selected, :delete => Comment.last.id
+ end
+ assert_redirected_to admin_comments_path
+ end
+
+
def test_should_fail_to_create_post_comment
login_as :aaron
assert_no_difference Comment, :count do
View
10 test/functional/users_controller_test.rb
@@ -442,8 +442,14 @@ def test_should_show_user_statistics
assert_response :success
end
-
-
+ def test_should_delete_selected
+ login_as :admin
+ assert_difference User, :count, -1 do
+ post :delete_selected, :delete => users(:florian).id
+ end
+ assert_redirected_to admin_users_path
+ end
+
protected
def create_user(options = {})
params = {:user => {:login => 'quire', :email => 'quire@example.com', :password => 'quire123', :password_confirmation => 'quire123', :birthday => 15.years.ago}}
View
1 test/unit/user_test.rb
@@ -204,7 +204,6 @@ def test_should_prohibit_reserved_logins
user = create_user(:login => 'contests')
assert !user.valid?
end
-
protected
def create_user(options = {})

0 comments on commit 6a0b949

Please sign in to comment.