OK, so instead of writing a whole bunch of access control specs, and duplicating them across many of my spec files, I'm looking to create a custom matcher. So instead of this:
describe "access control" do
it "should prevent access by non-logged-in users"
it "should prevent access by normal users"
it "should prevent access by editor users"
it "should prevent access by admin users"
it "should allow access by super admin users"
end
I want do something like this:
lambda do
get :index
end.should have_access_control(:allowed => [:super_admin], :disallowed => [:admin, :editor, :user])
Are there any examples or suggestions of how I can go about doing something like this?