Please quote when replying.
Peter Hultgren wrote in post #949955:
Ah, so the question was unclear. Let me try to rephrase it:
I want to write a test against my controller to make sure that the
actions respond as they should, but since I have HTTP authentication
turned on I get failures like this:
"response to be a <:success>, but was <401>"
So the test runs just fine with authentication turned off, but fails
when turned on. What should I do to get past this and be able to test
the logic of my controller?
Have your test code log in at the beginning of your tests. With
controller tests, that probably goes in a before block; with Cucumber
stories (which I highly recommend using instead), you actually want that
in your scenarios themselves (or your scenario background), in order to
better document and model the workflow.