Skip to content

Instantly share code, notes, and snippets.

@noahhendrix
Created September 29, 2011 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save noahhendrix/1251874 to your computer and use it in GitHub Desktop.
Save noahhendrix/1251874 to your computer and use it in GitHub Desktop.
Testing a regular user can not create a user
require 'test_helper'
require 'clearance/testing'
class EmployeesControllerTest < ActionController::TestCase
test "an ASM can not create a user" do
sign_in
post :create, :employee => { :name => 'Feed Store' }
assert_raise CanCan::AccessDenied
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment