Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bborn committed Jun 18, 2011
1 parent f1f6bbf commit 6a0b949
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
9 changes: 9 additions & 0 deletions test/functional/comments_controller_test.rb
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions test/functional/users_controller_test.rb
Expand Up @@ -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}}
Expand Down
1 change: 0 additions & 1 deletion test/unit/user_test.rb
Expand Up @@ -204,7 +204,6 @@ def test_should_prohibit_reserved_logins
user = create_user(:login => 'contests')
assert !user.valid?
end


protected
def create_user(options = {})
Expand Down

0 comments on commit 6a0b949

Please sign in to comment.