Displaying 11 results from an estimated 11 matches for "assert_recognizes".
2010 Feb 15
1
possible bug: using assert_recognizes with extras
Hi.
I am trying to use the extras hash parameter in assert_recognizes. I
am using.
assert_recognizes(expected_options, path, extras={}, message=nil)
I have something similar to the documentation:
assert_recognizes {:controller => ''items'', :action => ''list'', :id => ''1'', :view => ''print'&...
2008 Jan 02
1
assert_recognizes with requirements => {:method => something}
...ions'', :action =>
''new'', :requirements => { :method => :get }
map.connect ''/login'', :controller => ''sessions'', :action =>
''create'', :requirements => { :method => :post }
and I have these tests:
a. assert_recognizes({:controller => ''sessions'', :action => ''new''},
{:path => ''/login'', :method => :get})
b. assert_recognizes({:controller => ''sessions'', :action => ''create''},
{:path => ''/login'...
2006 May 18
6
Routes and Testing Routes
...quot;
opts = {:controller => ''user/version'', latform_filter => "all",
:software => "eudora",
:version => "7.0.1", latform => "windows",
:distribution_channel => "download", :id => 5}
assert_recognizes(opts, url) # Assertion fails!
end
[/code]
I really don''t understand why this is failing, even the error message
doesn''t make sense:
[code]
The recognized options <{"software"=>"eudora",
"platform"=>"windows",
"action&quo...
2006 May 09
1
name_url in tests
...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 getting an error when I try and use it in assert_recognizes (see below).
Is there anything in particular I have to do to get the _url functionality imported into my tests?
I''m using rails 1.1.2
thanks for any pointers in the dark-arts of URL rewriting tests.
dorian
Test:
# named routes
opts = { :action => "dotest", :test...
2009 May 02
10
Problem verifying routing error
...rray.
The error occurred while evaluating nil.first
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/assertions/routing_assertions.rb:134:in
`recognized_request_for''
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/assertions/routing_assertions.rb:49:in
`assert_recognizes''
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/assertions.rb:54:in
`clean_backtrace''
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/action_controller/assertions/routing_assertions.rb:47:in
`assert_recognizes''
./spec/controllers/thoughts_routing_spec...
2006 May 17
0
Strang Behavior when testing Routes
...n => "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_generates
and the assert_recognize...
2005 Dec 14
0
assert_generates and catch-all routes
I have a catch all route.
map.connect ''people/*args'', :controller => ''people'', :action =>
''default_action''
I can test this one way, with assert_recognizes.
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 a...
2011 Apr 21
0
Routing assertions
...----------------------------------------------------------------------------------
For first route
assert_routing({:path => "admin/categories"}, {:controller =>
''admin'', :action => ''categories''})
For second route
assert_recognizes({:controller=>''admin'', :action =>
''categories'', :sub_category=>''2''}, ''admin/categories/2'')
-------------------------------------------------------------------------------------------------------------------------------...
2007 Jul 02
6
Testing route globbing and limitations of get()
...ls and also to rspec, but I tried to do my homework. To answer
my questions, I searched this list''s archives, the Rails API, and Google, to
no avail. Therefor, I''d be grateful if someone could point me in the right
directions:
1) There doesn''t seem to be a counterpart to assert_recognizes in rspec.
route_for() won''t work with route globbing (or will it?) So, how do I test
route globbing?
2) Still using route globbing, if I do
get ''/something/somewhere''
rspec will complain that it couldn''t find an action for
''/something/somewhere'...
2009 Mar 15
0
rspec-rails 1.2.0 Released
...cements
* Adding status codes to redirect_to matcher (Damian Janowski). Closes #570.
* Initialize current URL before executing any examples in a
ViewExampleGroup (Wilson Bilkovich). Closes #654.
* Support query strings in params_from (Wilson Bilkovich). Closes #652.
* delegate route_for to assert_recognizes (less brittle)
* it { should be_valid } (Kakutani). Closes #665.
* controller is implicit subject in controller specs (Joe Ferris). #686.
* template is implicit subject in view specs (Joe Ferris). #686.
* redirect_to and render_template matchers can accept controller or
response (Joe Ferris...
2006 May 18
2
Help with Routes
...quot;
opts = {:controller => ''user/version'', latform_filter => "all",
:software => "eudora",
:version => "7.0.1", latform => "windows",
:distribution_channel => "download", :id => 5}
assert_recognizes(opts, url) # Assertion fails!
end
[/code]
I really don''t understand why this is failing, even the error message
doesn''t make sense:
[code]
The recognized options <{"software"=>"eudora",
"platform"=>"windows",
"action&quo...