Is it possible to tell the view in a view spec (rspec 2.11) on which path to look for partials.
The app is using prepending a view path like this:
class class Admins::ApplicationController < ApplicationController
before_filter :prepend_view_paths
def prepend_view_paths
prepend_view_path "app/views/admin"
end
end
Now I want to write a view spec for an admin template (like app/views/admin/users/new.html.haml) which uses a partial from app/views/admin/_form.html.haml.
So far so good while rendering the template I get the error that the partial can't be found because it is only looking in APP_DIR/app/views.
I can stub the template with
stub_template '_form' => 'form'
but actually i want to cover rendering of the partial as well.
So any idea how to prepend the path in the spec?
Aucun commentaire:
Enregistrer un commentaire