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.
0bd8b10ad45ca639c1183ca0581c79ab?d=identicon&s=25 Alex (Guest)
on 2009-03-25 21: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
1b32ae81cae0813e933ca2f8be830c9f?d=identicon&s=25 Chris Flipse (Guest)
on 2009-03-26 03:07
(Received via mailing list)
I havn't done this myself, but would
controller.stub!(:around_filter_method).and_yield  work?
0bd8b10ad45ca639c1183ca0581c79ab?d=identicon&s=25 Alex (Guest)
on 2009-03-26 19:57
(Received via mailing list)
Works like a charm!

Thanks a lot.
0bd8b10ad45ca639c1183ca0581c79ab?d=identicon&s=25 Alex (Guest)
on 2009-03-26 21:04
(Received via mailing list)
Works like a charm!

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