Forum: RSpec Specs for ActionMailer views

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E9799593a0bbdefeb9b9651bae9b9c4d?d=identicon&s=25 Stephen Veit (Guest)
on 2008-10-26 23:40
(Received via mailing list)
Folks,

Has anyone written specs for ActionMailer views? What type should I use.
I
can't use :view since it expects a controller. Should I make my own
Spec::Rails::Example::ViewExampleGroup class? TIA.
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2008-10-27 03:57
(Received via mailing list)
On Sun, Oct 26, 2008 at 5:33 PM, Stephen Veit <srveit@gmail.com> wrote:
> Folks,
>
> Has anyone written specs for ActionMailer views? What type should I use. I
> can't use :view since it expects a controller. Should I make my own
> Spec::Rails::Example::ViewExampleGroup class? TIA.

I just use the ViewExampleGroup, which uses its own controller that
renders the view template. The view template isn't really expecting a
controller. It does not care what is rendering it, as long as the
various instance variables are assigned.

HTH,
David
This topic is locked and can not be replied to.