allow_forgery_protection.rb 382 B

12345678910111213
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. RSpec.configure do |config|
  3. config.around(:each, :allow_forgery_protection) do |example|
  4. orig = ActionController::Base.allow_forgery_protection
  5. ActionController::Base.allow_forgery_protection = true
  6. example.run
  7. ensure
  8. ActionController::Base.allow_forgery_protection = orig
  9. end
  10. end