Skip to content

Commit

Permalink
Clean up user test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordan Byron committed Jun 2, 2011
1 parent 22a287b commit c8a1a7a
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions test/integration/admin/users_test.rb
Expand Up @@ -2,32 +2,27 @@

module Admin
class UsersTest < ActionDispatch::IntegrationTest

setup do
@admin_user = Factory(:user, :admin => true)
@admin_user.authorizations.create(:provider => "github", :uid => "12345")
end

test "Admin users can edit other users" do
pending && return
other_user = Factory(:user, :admin => false, :name => "Edit Me", :nickname => "Edit Me")

visit root_path
assert_current_path "/"

sign_user_in

assert_content "Log out"


visit edit_admin_user_path(other_user.id)

assert_content other_user.name

check "user_admin"
click_button "Save"

assert_current_path admin_users_path


assert_content "Edit User"

check "Admin"

click_button "Update User"

assert_current_path admin_user_path(other_user)

assert other_user.reload.admin, "Other user not set to admin!"
end
end
Expand Down

0 comments on commit c8a1a7a

Please sign in to comment.