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
I havn''t done this myself, but would controller.stub!(:around_filter_method).and_yield work? On Wed, Mar 25, 2009 at 4:15 PM, Alex <afolgueras at gmail.com> wrote:> 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 > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-- // anything worth taking seriously is worth making fun of // http://blog.devcaffeine.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20090325/967261ba/attachment.html>
Works like a charm! Thanks a lot. On Mar 25, 9:59?pm, Chris Flipse <cfli... at gmail.com> wrote:> I havn''t done this myself, but would > controller.stub!(:around_filter_method).and_yield ?work? > > On Wed, Mar 25, 2009 at 4:15 PM, Alex <afolgue... at gmail.com> wrote: > > 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 > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.org > >http://rubyforge.org/mailman/listinfo/rspec-users > > -- > // anything worth taking seriously is worth making fun of > //http://blog.devcaffeine.com/ > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users
Works like a charm! Thanks a lot. On Mar 25, 9:59?pm, Chris Flipse <cfli... at gmail.com> wrote:> I havn''t done this myself, but would > controller.stub!(:around_filter_method).and_yield ?work? > > On Wed, Mar 25, 2009 at 4:15 PM, Alex <afolgue... at gmail.com> wrote: > > 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 > > _______________________________________________ > > rspec-users mailing list > > rspec-us... at rubyforge.org > >http://rubyforge.org/mailman/listinfo/rspec-users > > -- > // anything worth taking seriously is worth making fun of > //http://blog.devcaffeine.com/ > > _______________________________________________ > rspec-users mailing list > rspec-us... at rubyforge.orghttp://rubyforge.org/mailman/listinfo/rspec-users