#391 new
Ian White

[rspec-rails] render_partial view extensions issue

Reported by Ian White | April 22nd, 2008 @ 12:44 PM | in No-Milestone-Assigned

When you alias_method_chain render_partial in a plugin, or other code, rspec cuts the chain.

This means that in rspec render_partial may behave differently than in your app. (for instance if you have a plugin that intercepts render_partial).

This was really hard to test, as the view extensions have to be loaded after the alias_method_chain. (If anyone can offer any advice on this sort of test, please let me know.)

The spec for this is here: http://github.com/ianwhite/rspec...

The fix is here: http://github.com/ianwhite/rspec...

The reason I haven't bundled it all up in one commit, is that I'm getting a failure that I don't really understand here:

ActionView::TemplateError in 'A view that includes a partial using an array as partial_path should render have the array passed through to render_partial without modification'
Missing template strings/_string.html.erb in view path /Users/ian/dev/ianwhite/rspec-dev/example_rails_app/app/views:./vendor/plugins/rspec-rails/spec/rails/extensions/../../../spec_resources/views:./vendor/plugins/rspec-rails/spec/rails/example/../../../spec_resources/views:./vendor/plugins/rspec-rails/spec/rails/autotest/../../../spec_resources/views:./vendor/plugins/rspec-rails/spec/rails/matchers/../../../spec_resources/views:/Users/ian/dev/ianwhite/rspec-dev/example_rails_app/vendor/plugins/rspec-rails/spec/../spec_resources/views:./vendor/plugins/rspec-rails/spec/rails/mocks/../../../spec_resources/views:./vendor/plugins/rspec-rails/spec/rails/../../spec_resources/views

This looks like a hidden bad side-effect of the original code to me ('string' being a class name). Could the person who wrote the render_partial stuff point me in the right direction?

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Behaviour Driven Development for Ruby.

Shared Ticket Bins

People watching this ticket