[rspec-users] How do I include routing path helpers?

Evgeniy Dolzhenko dolzenko at gmail.com
Sat Nov 13 15:31:42 EST 2010


We're into some horrible throw-it-and-see-if-it-works loop now, but I
can tell you
here is what I use in my `before` blocks to test the subdomain routing
in controller specs:

request.env.merge!('HTTP_HOST' => 'hi5.test.host')

On Sat, Nov 13, 2010 at 7:54 PM, Steve <vertebrate at gmail.com> wrote:
> That didn't seem to change anything. I'll have to keep playing with
> it, but if you have any other thoughts I'm all for it.
>
> On Nov 13, 5:53 am, Evgeniy Dolzhenko <dolze... at gmail.com> wrote:
>> Hm, make sure you have something like
>>
>> MySuperApp::Application.configure do
>>   routes.default_url_options = { :host => "test.host", :protocol => 'https' }
>> end
>>
>> in your config\environments\test.rb
>>
>>
>>
>> On Sat, Nov 13, 2010 at 4:01 AM, Steve <vertebr... at gmail.com> wrote:
>> > Thanks, that did it. I still have a nil error when trying to call
>> > host_with_port on the request object inside url_for, but I think that
>> > is related to my app having subdomains, and trying to use those with
>> > capybara.
>>
>> > On Nov 12, 2:56 pm, Evgeniy Dolzhenko <dolze... at gmail.com> wrote:
>> >> Not sure on how to do that with Steak but you must be looking to
>> >> include Rails.application.routes.url_helpers
>> >> somewhere, with vanilla RSpec it would be
>>
>> >> describes 'included helpers' do
>> >>   include Rails.application.routes.url_helpers
>> >>   ...
>> >> end
>>
>> > _______________________________________________
>> > rspec-users mailing list
>> > rspec-us... at rubyforge.org
>> >http://rubyforge.org/mailman/listinfo/rspec-users
>>
>> _______________________________________________
>> rspec-users mailing list
>> rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list