Subdomain test

Hi guys,
I’m developing a app where each subdomain has a independent data set.
I did a few tries to rewrite a test for this, but all were unsuccessful.
Do someone has a example how I can do that? any reference will help.

Thanks,

Pablo
[email protected]

On Monday, 11 April 2011, Pablo L. de Miranda [email protected]
wrote:

Hi guys,
I’m developing a app where each subdomain has a independent data set.
I did a few tries to rewrite a test for this, but all were unsuccessful.
Do someone has a example how I can do that? any reference will help.

In our app, we’ve used a request spec to specifically check some of
our subdomain-related behaviour:

This works by passing full URLs to #get, #post, etc…

The rest of the app specs rely on a method in ApplicationController
which checks the subdomain of the request and does the necessary setup
and data look-up. In the app, this is called in a before_filter on
every action, and in the specs we stub this method to return the
appropriate mock objects.

Hope that gives some guidance.

Chris

Chris,

Thanks man, it’s great your code. I did a fork and started study it.

Thank you again,

Pablo
[email protected]