[Catalyst] Testing OpenID Logins + more
bobtfish at bobtfish.net
Wed Sep 2 17:48:03 GMT 2009
On 1 Sep 2009, at 04:43, fREW Schmidt wrote:
> I'd really like to start testing my controllers, and I wished I'd
> started sooner, but oh well. The biggest barrier at this point is
> the login system. It uses OpenID for auth, which is where the hard
> stuff comes from.
Why bother with the complexity when testing if it isn't the OpenID
stuff your testing specifically.
I'd arrange for the relevant tests to supply a custom config file (I
do this by mangling MYAPP_CONFIG env variable in the tests, although
I'm sure there are more elegant solutions)..
You can then change the authentication config to use different auth
modules (for example authenticating a hard-coded list of test users
with known roles) for the purposes of testing your controllers.
You still want to do _some_ testing of login / logout etc, but there
is no point in jumping through hoops for _all_ of your controller
Hope this helps.
More information about the Catalyst