Re: [rspec-users] GET a path in a controller spec

2010-02-21 Thread Pat Maddox
Extract redirect logic to an object or helper and test that. UrlRewriter.new.rewrite('/foods/search/almonds').should == '/almonds' helper.rewrite_url('/foods/search/almonds').should == '/almonds' and then you will see that this should probably be called higher up in the call stack, in a before_f

Re: [rspec-users] GET a path in a controller spec

2010-02-21 Thread Andrew Premdas
On 31 January 2010 22:02, Nick Hoffman wrote: > One of my controller actions sends a redirect if the request URI begins > with /foods/search > > 34 def search > 35return redirect_to "/#{params[:name]}" if > request.request_uri.match /^\/foods\/search/ > > Unfortunately, I can't figure out

Re: [rspec-users] GET a path in a controller spec

2010-02-01 Thread J. B. Rainsberger
On Sun, Jan 31, 2010 at 17:02, Nick Hoffman wrote: > One of my controller actions sends a redirect if the request URI begins > with /foods/search > >  34  def search >  35    return redirect_to "/#{params[:name]}" if > request.request_uri.match /^\/foods\/search/ > > Unfortunately, I can't figure