Created
January 11, 2013 05:35
-
-
Save davetapley/4508214 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you have a filter which is used in a lot of controllers and thus requires constant mocking | |
# implicitly skip before_filter in all controllers: | |
# in spec_helper.rb | |
config.before(:each) do | |
if defined? controller and not example.options[:with_before_filter] == :my_filter | |
controller.class.skip_before_filter :my_filter | |
end | |
end | |
# if you want to run the filter | |
it 'does stuff', with_before_filter: :my_filter do | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment