# Use Rails test environment to test other kinds of servers

**URL:** <https://www.ruby-forum.com/t/use-rails-test-environment-to-test-other-kinds-of-servers/167108>\
**Category:** Rails\
**Created:** [May 4, 2009, 4:24am UTC](https://www.ruby-forum.com/t/use-rails-test-environment-to-test-other-kinds-of-servers/167108 "2009-05-04T04:24:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [May 4, 2009, 4:24am UTC](https://www.ruby-forum.com/t/use-rails-test-environment-to-test-other-kinds-of-servers/167108/1 "2009-05-04T04:24:04Z")

</div>

I want to use the very powerful Rails testing framework to test  
different kinds of servers (in my case, WordPress with some plugins  
I’m developing).

WordPress will run on ‘localhost’ and the database will be local.

I’ll write the models to describe the database, so that Rails has full  
visibility into the data. I’ll use the fixtures and everything else.

What’s needed is a way get the POST and GET calls to issue real HTTP  
requests (normally, to ‘localhost’) and get the results from these  
calls back to Rails. From there, it’s an smooth sail. I’ll be able to  
use all the asserting calls and write normal looking tests.

My question is - how do I bend the test environment so that? Where can  
I override the normal test code so that it issues real HTTP calls and  
collects their output?

Thanks!  
Amir Helzer

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [May 4, 2009, 6:50pm UTC](https://www.ruby-forum.com/t/use-rails-test-environment-to-test-other-kinds-of-servers/167108/2 "2009-05-04T18:50:24Z")

</div>

helzer wrote:  
[…]

> I’ll write the models to describe the database, so that Rails has full  
> visibility into the data. I’ll use the fixtures and everything else.

I tend to think this is a bad idea. Rails likes its DB set up a certain  
way, and that may or may not correspond to what WordPress expects.

However, you should still be able to use Ruby to test stuff – just  
probably without Rails.

> What’s needed is a way get the POST and GET calls to issue real HTTP  
> requests (normally, to ‘localhost’) and get the results from these  
> calls back to Rails. From

Take a look at Webrat and Selenium. Also check out Cucumber and RSpec.  
But don’t expect to throw Rails into the mix.

[…]

> Thanks!  
> Amir Helzer

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid
