[rspec-devel] [ rspec-Bugs-11777 ] should render_template doesn't check paths correctly

noreply at rubyforge.org noreply at rubyforge.org
Sat Jun 23 07:33:25 EDT 2007


Bugs item #11777, was opened at 2007-06-22 18:07
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11777&group_id=797

Category: rails plugin
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 3
Submitted By: Chad Woolley (thewoolleyman)
>Assigned to: David Chelimsky (dchelimsky)
Summary: should render_template doesn't check paths correctly

Initial Comment:
For example, if you render 'something/new', should render_template will not fail even if given 'new'.  Also, if you render 'badpath/new', it will also not fail.

This was in a RESTful app, if that makes a difference.

Thx,
--Chad

----------------------------------------------------------------------

>Comment By: David Chelimsky (dchelimsky)
Date: 2007-06-23 11:33

Message:
Fixed in r2109.

I fixed the problem with 'badpath/new', but the other issue you raise, that it does not fail when you say 'new', is as intended as long as the path matches the controller you are describing. For example, if you say:

describe ThingController
  it "should ..."
    get 'new'
    response.should render_template('new')
  end
and

and what's being rendered is 'thing/new', then it should pass. Whereas if what's being rendered is 'other/new' then it should fail.

----------------------------------------------------------------------

Comment By: Chad Woolley (thewoolleyman)
Date: 2007-06-22 18:08

Message:
FYI, this was in 1.0.0.  We'll upgrade and let you know if
it went away...

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3149&aid=11777&group_id=797


More information about the rspec-devel mailing list