Skip to content

Instantly share code, notes, and snippets.

@jslag
Created June 23, 2011 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jslag/1043625 to your computer and use it in GitHub Desktop.
Save jslag/1043625 to your computer and use it in GitHub Desktop.
require 'test_helper'
class EntriesAdminControllerTest < ActionController::TestCase
tests Admin::EntriesController
include Devise::TestHelpers
def setup
@admin = Factory.create(:user)
end
test "can access admin-only features " do
sign_in @admin
get :index
assert_response :success
# can now test admin code!
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment