similar to: testing named routes

Displaying 20 results from an estimated 400 matches similar to: "testing named routes"

2006 May 09
1
name_url in tests
Hi there, I posted earlier asking about testing named routes in functional tests, but got no response, so I''m making my question less specific. It seems from the docs that it''s possible to to test named routes in cases such as: asserts_redirect_to name_url(:param => "whatever") but I haven''t seen any mention of it being used with any other tests and I keep
2012 Jun 13
1
what does .indexDate() do - R::xts
Dear R experts, I am learning the very useful XTS package, but cannot figure out the purpose of some commands. in particular, the .indexDate() command does not work as expected. say: x <- timeBasedSeq('2010-01-01/2010-01-02 12:00') x <- xts(1:length(x), x) then i can subset on date as follows: x['2010-01-01'] however the .indexDate() command does not work as expected;
2011 Apr 21
0
Routing assertions
Hi Thanks for help me out I have two routes : match ''admin/categories'' => ''admin#categories'', :as => ''admin_category'' match ''admin/categories/:sub_category'' => ''admin#categories'' In rspec
2006 Mar 26
2
Controllers in modules, not recognised - driving me mad!
Hi, I hope somebody can help me here but I''m having a very strange problem getting Rails to recognise controllers inside modules. The strange thing is, it was working the other day and I''ve not changed anything as far as I''m aware. I''m running on OSX using Ruby 1.8.4 and Rails RC1 (but I''ve also tried rolling back to Rails 1.0 and tried Edge Rails)
2006 Jun 28
2
simply_restful plugin tests failing???
Has anyone successfully ran the simply_restful tests? Here is how I''m running the tests and the first error. I''m I missing something here? >rails test >cd test >rake rails:freeze:edge >./script/plugin install simply_restful >ruby vendor/plugins/simply_restful/test/routing_test.rb Loaded suite vendor/plugins/simply_restful/test/routing_test Started FFFFF
2007 Feb 07
3
Upgrade to Rails 1.2.2 : RESTful routes not working anymore
Hello, I just upgraded my app to Rails 1.2.2. My routes are : map.with_options :path_prefix => "/admin", :name_prefix => "admin_" do |m| m.resources :requests, :controller => "admin/requests", :collection => { :destroy => :delete, :search => :post } do |request| request.resources :histories, :path_prefix =>
2010 Oct 01
1
I18n.with_options bloc executed TWICE
Hi, to avoid putting the whole locale scope on every I18n.t call I''m trying to use a scope, as stated in the doc (http://guides.rubyonrails.org/active_support_core_extensions.html#with_options) I tried with <%= I18n.with_options :locale => :en, :scope => ''portal.visitor_menu'' do |i18n|%> Try <%= i18n.t :fav_songs %> <% end %> But it produce
2007 Aug 17
0
map.with_options :path_prefix => ''
Hello, I am getting a ''No route matches'' error in rspec with routes that have a path_prefix composed by map.with_options. Rails recognizes the routes just fine and the site works, but I can''t get the specs to pass unless I put the prefix in each individual route. Any help is appreciated. My foo model has a polymorphic owner which is what I want the path_prefix to
2007 Jan 17
8
Mocha Mock''s hanging on after test run?
Hi guys, I''m running mocha (0.3.2) against Rails core and just found an issue where the mock doesn''t go away after the test is run. For example: def test_reset_bang_doesn_reinstall_named_routes ActionController::Routing::Routes.named_routes.expects(:install).never @session.reset! end def test_zzz puts ActionController::Routing::Routes.named_routes.inspect
2007 Mar 06
4
Rails 1.2 / Theme support plugin issue: Fix
This is to answer one of my old issues, that I was having using Theme support plugin using with Rails 1.2. When you get an latest edge Rails update and run your application which has Theme support plugin you will get following error /script/../config/../vendor/plugins/theme_support/lib/patches/routeset_ex.rb:26:in `create_theme_routes'': undefined method `named_route'' for
2006 May 24
2
named routes confusion
Hi, I''m trying generate a URL from a named route like: namedroute_url(params...) but the generated route is always coming out as the first match from the routes table. The named route is defined inside a map.with_options block, but that shouldn''t matter should it? dorian -- -- I do things for love or money
2007 Dec 14
2
Rails 2.0 map.namespace and path_prefix
Hi! I''m trying set up new routing in rails 2.0 and have 1 problem map.namespace :admin do |admin| admin.resources :permissions, :path_prefix => ''/:lang'' end i want have addres like this: http://site.com/en/admin/permissions also i tested: map.with_options :path_prefix => ''/:lang'' do |lang| lang.namespace :admin do |admin|
2006 May 17
0
Strang Behavior when testing Routes
I have the following route: [code] map.connect '':platform_filter/:software/:version/:platform/:distribution_channel/:id'', :controller => ''user/version'', :platform_filter => /all/, :platform => /windows|macintosh|unix|linux/, :distribution_channel => /Download|download/, :action => ''download'', :id =>
2018 Dec 04
3
patch to support custom HTTP headers in download.file() and url()
The patch below adds support for custom HTTP headers in download.file() and url(). My main motivation for this is performing basic http authentication. Some web sites do not support embedding the credentials into the URI itself, they only work if the username and password are sent in the HTTP headers. In fact specifying the username and password in the URI has been
2006 Apr 04
1
subdomain routing
According to the wiki (http://wiki.rubyonrails.org/rails/pages/Routes) you can handle subdomain routing in routes.rb. Like this: with_options :requirements=>{:subdomain=>''first.com''} do map.connect '''', :controller => "first/catalog" map.connect ''featured'', :controller => "first/catalog",
2006 Jul 31
0
problems testing helpers - link_to and url_for don''t work...
So I''ve used the helper test plugin, and also tried some things from Rails Recipes, and basically neither seems to work for cases where a helper does anything related to link_to/url_for, and this includes calling named_routes. This is obviously an issue, as a common use for helpers is to refactoring something like this: <%= link_to "text that changes slightly", :id => id
2006 Mar 23
10
Domain Requirements in Routes (Edge Rails)
I saw on the bottom of the following page that you can route requests to different controllers based upon which subdomain is being requested. http://wiki.rubyonrails.com/rails/pages/Routes with_options :requirements=>{:subdomain=>''first.com''} do map.connect '''', :controller => "first/catalog" map.connect ''featured'',
2011 Jan 19
6
rake aborted! can't convert Hash into String
Hello, I encouter a problem when i try to do "rake db:migrate": rake aborted! can''t convert Hash into String Here is the trace result: ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! can''t convert Hash into String /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/fileutils.rb:1408:in
2007 Nov 07
0
Named routes raising nil.rewrite error
Hi all. I''m having a little problem with named routes. I have the following named route: map.with_options :controller => ''snippets'' do |map| map.snippets ''faq/'', :action => ''index'' map.new_snippet ''faq/ new'', :action
2007 Aug 10
0
ActiveRecordAssociationMatcher
I''ve started to put together a custom expectation matcher for specifying AR associations. Its not quite complete and I really need to put some specs together for it, but I''d appreciate any comments. It lets you spec your associations like this: describe Record do include ActiveRecordAssociationMatchers it "should belong to artist and use a counter cache" do