Skip to content

Instantly share code, notes, and snippets.

@ryanb
Forked from noahhendrix/employees_controller_test.rb
Created September 30, 2011 20:48
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 ryanb/1254934 to your computer and use it in GitHub Desktop.
Save ryanb/1254934 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
assert_raise CanCan::AccessDenied do
post :create, :employee => { :name => 'Feed Store' }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment