I have a bunch of recurring tests for some of my controller actions, all of which require authentication. As a result, you end up seeing a lot of code like the following:
describe "authentication requests" do
it "should return 401 for unauthenticated :show" do
get :show
...
end
it "should return 401 for unauthenticated :create" do
post :create
...
end
end
Is there a better way to DRY this code up so that any action in the controller that needs authentication can be described in one test?