On Feb 21, 3:39 am, Jeremy Woertink <[email protected]> wrote:
> Ok, so, I'm trying to write my first gem to learn how it all works.
> Basically the gem would just be an extra view helper, so I want any
> methods in my module to be accessible in a rails app view.
>
> I want my method to call render, and render a partial I have in my gem's
> app/views/shared folder. When I call "render", and run my rspec test I
> get an undefined method render for the rspec stuff. I've tried including
> ActionView::Base, and requiring it, and even tried just calling
> ActionView::Base.new.render :partial => 'shared/my_partial'. Calling it
> directly will call the render method, but I get a Missing partial error.
> Same thing happens if I call the full path to that partial.

rspec should realise that the code under test is a helper is the spec
is in spec/helpers (and so should add the required stuff to the test
environment that allows you to call actionviewy stuff.

Fred
>
> My gem is structured like
>
> MyGem
> -lib
> --my_gem.rb
> -app
> --views
> ---shared
> ----_my_partial.html.erb
> -spec
> ...
>
> Thanks
>
> ~Jeremy
>
> --
> Posted viahttp://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to