# One functional test spoils another

**URL:** <https://www.ruby-forum.com/t/one-functional-test-spoils-another/155876>\
**Category:** Rails\
**Created:** [December 17, 2008, 9:23pm UTC](https://www.ruby-forum.com/t/one-functional-test-spoils-another/155876 "2008-12-17T21:23:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fritza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/5f9b8f/32.png) [@fritza](https://www.ruby-forum.com/u/fritza)\
**Post date:** [December 17, 2008, 9:23pm UTC](https://www.ruby-forum.com/t/one-functional-test-spoils-another/155876/1 "2008-12-17T21:23:36Z")

</div>

In my functional test suite, I have two tests. Each is meant to test the  
redirection that “verify :method =\> :post” will do when I trigger the  
respective actions with a GET instead of a POST.

In both tests, I have a follow\_redirect.

If both tests are present (or more precisely, if the follow\_redirect is  
present in the alphabetically-earlier one), the second test will fail at  
the assert\_redirected\_to. The redirected URL is a loopback to the  
action’s URL. That redirection might have come from ssl\_required, though  
the original request includes HTTPS.

So anyway, if I do a follow\_redirect after a get in a functional test,  
redirections following gets’es in later tests are screwed up.

Is this known?

Is there anything I can do about it?

```
â€” F

```

ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]  
Rails 1.2.6
