Topic: rspec with account_location

Hi everyone,

I recently hooked up the account_location plugin and of course it ruined all my tests.

I'm having a big issue here, I've got a method called current_account in the application_controller that goes and finds the account via the subdomain.

How do I reference that in my tests? 

Here's my code:

application.rb

  def current_account
    if account_subdomain.nil?
      return nil
    else
      Account.find_by_subdomain(account_subdomain)
    end
  end

projects_controller.rb
  def index
    @projects = current_account.projects.find(:all)
   
    respond_to do |format|
      format.html { render :layout => "application" }
      format.xml  { render :xml => @projects.to_xml }
    end
  end

projects_controller_spec.rb
  before do
    @request.host = "testaccount.test.host"
  end

  it "should find all projects" do
    current_account.should_receive(:projects)
    do_get
  end


Any help would be a lifesaver.

Thanks!