twg/comfortable-mexican-sofa — Issue #102: Can't functional test after inheriting from CmsAdmin::BaseController
Author: sdball
Created: 2011-10-18 21:21:26+00:00
State: open

I have a controller that I'm pulling into the admin area and placing behind http basic authentication by having it inherit from CmsAdmin::BaseController. The trouble I'm running into is that my functional tests don't pass.

Just after inheriting from CmsAdmin::BaseController my functional tests were all returning 401 instead of success.

I added this snippet to my test helper and got all the functional tests to return 302 instead of success, but tests like "should create" aren't able to create new entries.

class ActionController::TestCase
def setup
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials('username', 'password')
end
end

The tests are all still out of the box from a generate scaffold.