search for: assert_generates

Displaying 7 results from an estimated 7 matches for "assert_generates".

2005 Dec 14
0
assert_generates and catch-all routes
...s. expected_options = { :controller => ''people'', :action => ''default_action'', :args => [''made_up''] } assert_recognizes expected_options, ''people/made_up'' I''m wondering why I cannot test the other way, using assert_generates? options_for_url = { :controller => ''people'' } assert_generates ''people/default_action'', options_for_url The above fails with "ActionController::RoutingError: No url can be generated for the hash". I assume I am missing something in my understand...
2006 Jan 07
2
Functional tests with routes
Hi all, I''m trying to do a route test using assert_generates and running into a bit of trouble. The controller that I am testing is in a module - class Admin::AdminPortalController def index end end I want the user to jump to the AdminPortal/index action when they use http://myApp/admin, so I''ve put the following in routes.rb map.admin_p...
2006 May 17
0
Strang Behavior when testing Routes
...", :action => "download", :version => r2006a, :software => matlab, :platform_filter => "all", :platform => "windows", :id => 1} assert_generates(url, opts) assert_recognizes(opts, url) assert_routing(url, opts) @request.env[''PATH_INFO''] = url post(:download, opts) assert_response(:redirect) assert_template(nil) end [/code] The test passes without failure! However, if I comment out the assert_...
2011 Apr 21
0
Routing assertions
...s'', :sub_category => ''2''}) Test::Unit::AssertionFailedError: found extras <{:sub_category=>"2"}>, not <{}> Why assert_routing method is failing for second route? And also let me know I which scenarios should I use assert_routing, assert_generates and assert_recognizes?
2009 Mar 15
0
rspec-rails 1.2.0 Released
...2.0.5, 2.1.2 and 2.2.2, and 2.3.1 * We are no longer supporting 1.x versions of rails. * expect_render and stub_render have been removed. * Both of these methods were deprecated in rspec-rails-1.1.5, released in Sept, 2008. * { route_for(args).should == "/path" } now delegates to assert_generates (in rails) * see Upgrade.markdown for more information * deprecations * controller.use_rails_error_handling! is deprecated * use rescue_action_in_public! (from rails) instead * enhancements * Adding status codes to redirect_to matcher (Damian Janowski). Closes #570. * Initialize cu...
2006 Jul 05
2
How to write get functional test when there is no action by that name
I have following line in route.rb #event info for an event name map.connect ''event/:name_url'',:controller => ''home'',:action => ''event_info'' It causes a URL like http://localhost:3000/event/_jewels_exhibition_ to be sent to the home controller with action as ''event_info''. I am trying to test this action. My first
2009 May 02
10
Problem verifying routing error
Hi, When upgrading to rspec/rspec-rails 1.2.6 gem (from 1.1.12), I''m having a new problem verifying routes that should not exist. This is to support something like this in routes.rb: map.resources :orders do |orders| orders.resources :items, :except => [:index,:show] end I used to use lambda {}.should_raise( routing error ), but it stopped detecting any raised error.