Forum: RSpec How to spec a around_filter

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.
Alex (Guest)
on 2009-03-25 22:17
(Received via mailing list)
Hi all, any of you guys had success specking out a around_filter? I
tried a few things like controller.should_receive
(:around_filter_method), controller.stub!(:around_filter_method) but
without success. In fact, the method is always executed even though I
stubed it. What I find strange is that I also have a before_filter and
I do not have any problems specking it. Why should it be different for
an around_filter?

Thanks
Chris F. (Guest)
on 2009-03-26 04:07
(Received via mailing list)
I havn't done this myself, but would
controller.stub!(:around_filter_method).and_yield  work?
Alex (Guest)
on 2009-03-26 20:57
(Received via mailing list)
Works like a charm!

Thanks a lot.
Alex (Guest)
on 2009-03-26 22:04
(Received via mailing list)
Works like a charm!

Thanks a lot.
This topic is locked and can not be replied to.