# Functional testing with account\_location plugin

**URL:** <https://www.ruby-forum.com/t/functional-testing-with-account-location-plugin/126124>\
**Category:** Rails\
**Created:** [January 15, 2008, 4:51pm UTC](https://www.ruby-forum.com/t/functional-testing-with-account-location-plugin/126124 "2008-01-15T16:51:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![retcheto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a87d85/32.png) [@retcheto](https://www.ruby-forum.com/u/retcheto)\
**Post date:** [January 15, 2008, 4:51pm UTC](https://www.ruby-forum.com/t/functional-testing-with-account-location-plugin/126124/1 "2008-01-15T16:51:29Z")

</div>

I’m using the account\_location plugin to let users create accounts  
([user.site.com](http://user.site.com))

in routes.rb I have:

map.connect ‘’, :controller =\> “site”, :conditions =\> { :subdomain =\>  
‘www’ }  
map.connect ‘’, :controller =\> “accounts”

so I can have a public facing [www.site.com](http://www.site.com) through site\_controller and  
have the accounts\_controller handle everything else.

In my functional tests for the site controller for example, if I do  
something simple like

get :index

the test tells me it’s been routed to the accounts controller. This must  
be because the test doesn’t know the subdomain perhaps. So I try

get ‘[www.site.com](http://www.site.com)’ or get :index, :subdomain =\> ‘www’

and have the same results.

How can you get functional tests to recognize the subdomain? I’m stumped  
on this one.
