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
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
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