public
Description: Simple rpsec matcher for testing ActionController's filters presence
Homepage:
Clone URL: git://github.com/fester/have_filter.git
name age message
file CHANGELOG Fri Aug 22 21:30:51 -0700 2008 Added for more human-friendly tracking of chang... [ngtzeyang]
file LICENSE Thu Jan 29 13:41:48 -0800 2009 MIT license added [fester]
file README Thu Mar 20 16:39:17 -0700 2008 First commit [Tim Baga]
file Rakefile Fri Aug 22 21:18:01 -0700 2008 Added to conform to the directory structure rec... [ngtzeyang]
file init.rb Fri Aug 22 21:10:27 -0700 2008 Updated to: 1. conform to the directory structu... [ngtzeyang]
file install.rb Fri Aug 22 21:18:01 -0700 2008 Added to conform to the directory structure rec... [ngtzeyang]
directory lib/ Fri Aug 22 21:13:54 -0700 2008 Revised and renamed to lib/have_filter.rb. [ngtzeyang]
directory spec/ Fri Aug 22 21:14:09 -0700 2008 Revised and renamed to spec/have_filter_spec.rb. [ngtzeyang]
directory tasks/ Fri Aug 22 21:18:01 -0700 2008 Added to conform to the directory structure rec... [ngtzeyang]
file uninstall.rb Fri Aug 22 21:18:01 -0700 2008 Added to conform to the directory structure rec... [ngtzeyang]
README
== HaveFilter matcher

HaveFilter matcher is a custom matcher for rspec suite. It's purpose is a testing of ActionController filters presense.
If you want to test presence of filters today, you have to do something like

@controller.before_filters.should include(:filter_name)

As for me, it just looks ugly. No, really.
I've spent some time thinking about it and made this filter. Sample usage could be found in 
spec/rails/matchers/have_filter_spec.rb
I'll post some here:

    @controller.should have_filter(:before_filter_method)
    @controller.should have_filter(:before_filter_method).before(:any_action)
    @controller.should have_filter(:after_some_actions_filter).after([:action_1, :action_2])

== Thanks

I would like to say 'thank you' to Yurii Rashkovskii (http://rashkovskii.com) and Michael Klishin 
(http://novemberain.com). Without them I would never get even a half of Ruby/Rails experience that I have now.
Also, thanks goes to my lovely wife and my family. They keep me turning.