aboutsummaryrefslogtreecommitdiffstats
path: root/spec/integration/alaveteli_dsl.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/integration/alaveteli_dsl.rb')
-rw-r--r--spec/integration/alaveteli_dsl.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/integration/alaveteli_dsl.rb b/spec/integration/alaveteli_dsl.rb
index 370628d98..d7485a094 100644
--- a/spec/integration/alaveteli_dsl.rb
+++ b/spec/integration/alaveteli_dsl.rb
@@ -74,5 +74,14 @@ def cache_directories_exist?(request)
paths.any?{ |path| File.exist?(path) }
end
+def with_forgery_protection
+ orig = ActionController::Base.allow_forgery_protection
+ begin
+ ActionController::Base.allow_forgery_protection = true
+ yield if block_given?
+ ensure
+ ActionController::Base.allow_forgery_protection = orig
+ end
+end