From 1c4496e6ff356ad71b422b7a13f400eeb675c7b5 Mon Sep 17 00:00:00 2001 From: Tom Dracz Date: Tue, 2 May 2017 12:52:06 +0100 Subject: [PATCH] Update for Rails 5.1 --- lib/mandrill-rails/web_hook_processor.rb | 4 ++-- spec/mandrill-rails/web_hook_processor_spec.rb | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/mandrill-rails/web_hook_processor.rb b/lib/mandrill-rails/web_hook_processor.rb index bfad945..6162c77 100644 --- a/lib/mandrill-rails/web_hook_processor.rb +++ b/lib/mandrill-rails/web_hook_processor.rb @@ -34,8 +34,8 @@ module Mandrill::Rails::WebHookProcessor extend ActiveSupport::Concern included do - skip_before_filter :verify_authenticity_token - before_filter :authenticate_mandrill_request!, :only => [:create] + skip_before_action :verify_authenticity_token, raise: false + before_action :authenticate_mandrill_request!, :only => [:create] end module ClassMethods diff --git a/spec/mandrill-rails/web_hook_processor_spec.rb b/spec/mandrill-rails/web_hook_processor_spec.rb index 3405085..aab7f0d 100644 --- a/spec/mandrill-rails/web_hook_processor_spec.rb +++ b/spec/mandrill-rails/web_hook_processor_spec.rb @@ -3,10 +3,10 @@ class WebHookProcessorTestHarness # Mock some controller behaviour # TODO: we should probably start using a real controller harness for testing - def self.skip_before_filter(*args) ; @skip_before_filter_settings = args; end - def self.skip_before_filter_settings ; @skip_before_filter_settings; end - def self.before_filter(*args) ; @before_filter_settings = args ; end - def self.before_filter_settings ; @before_filter_settings; end + def self.skip_before_action(*args) ; @skip_before_action_settings = args; end + def self.skip_before_action_settings ; @skip_before_action_settings; end + def self.before_action(*args) ; @before_action_settings = args ; end + def self.before_action_settings ; @before_action_settings; end def head(*args) ; end attr_accessor :params, :request @@ -22,15 +22,15 @@ def head(*args) ; end processor_class.on_unhandled_mandrill_events! nil end - describe "##skip_before_filter settings" do - subject { processor_class.skip_before_filter_settings } + describe "##skip_before_action settings" do + subject { processor_class.skip_before_action_settings } it "includes verify_authenticity_token" do - expect(subject).to eql([:verify_authenticity_token]) + expect(subject).to eql([:verify_authenticity_token, { raise: false }]) end end - describe "##before_filter settings" do - subject { processor_class.before_filter_settings } + describe "##before_action settings" do + subject { processor_class.before_action_settings } it "includes authenticate_mandrill_request" do expect(subject).to eql([:authenticate_mandrill_request!, {:only=>[:create]}]) end