[rspec-users] [Cucumber] ssl requirement

James Byrne lists at ruby-forum.com
Sat Feb 14 11:05:55 EST 2009


Wincent Colaiuta wrote:

>    # always return false for tests
>    return false if RAILS_ENV == 'test'
> 
> I brand this as "hideous" because it commits the heinous crime of
> dynamically modifying application behaviour only when execution within
> the testing context is detected. Ugh.
> 
> For the time being, though, looks like the only way to get my Cucumber
> features working. At least until I find out a better way.
> 
> Cheers,
> Wincent

I am reluctant to go forward on this because I have not yet dealt with 
this problem first hand.  However, I looked into this issue briefly in 
the past and it seemed to me that the behaviour you wish to test might 
be triggered by setting one or more of the following environment 
variables. Since you can set these outside your application code then 
this might satisfy your desire to avoid custom test code therein.

It appears that either one of these is sufficient by itself:

HTTPS = ‘on’
HTTP_X_FORWARDED_PROTO = ‘https’

I read somewhere that this one might prove necessary in addition to the 
foregoing.

HTTP_X_FORWARDED_SSL = ‘on’

As I wrote, I have not tested any of this.

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list