[rspec-users] How to define request.domain in when testing

Jarkko Laine jarkko at jlaine.net
Wed Sep 24 08:11:34 EDT 2008


On 24.9.2008, at 14.07, Fernando Perez wrote:

> Hi jarkko,
>
> I get the following error message:
> ---
> `load_environment': undefined method `default_url_options' for
> ActionController::Base:Class (NoMethodError)
> ---
>
>
>> From this
> ticket:http://rails.lighthouseapp.com/projects/8994/tickets/22-default_url_options-is-being-ignored-by-named-route-optimisation
>
> It was at that time expected to deprecate default_url_options, so  
> maybe
> it was removed from Rails 2.1?

Might be I've only played with it within action_mailer, where it still  
works:
config.action_mailer.default_url_options = { :host =>  
"development_url.com" }

Not sure if it works the same way with ActionController, though. You  
can of course set the request host by hand in a setup method:

@request.host = host

//jarkko

--
Jarkko Laine
http://jlaine.net
http://dotherightthing.com
http://www.railsecommerce.com
http://odesign.fi




More information about the rspec-users mailing list