Sha256: 20069276e25060bad493e63a51721af31f1b9fa4031628b3b3bc814c1190a4d0

Contents?: true

Size: 947 Bytes

Versions: 13

Compression:

Stored size: 947 Bytes

Contents

require 'clearance'

Clearance.configure do |config|
  # need an empty block to initialize the configuration object
end

# NOTE: to run the entire suite with signed cookies
#       you can set the signed_cookie default to true
#       and run all specs.
#       However, to fake the actual signing process you
#       can monkey-patch ActionDispatch so signed cookies
#       behave like normal ones
#
# class ActionDispatch::Cookies::CookieJar
#   def signed; self; end
# end

module Clearance
  module Test
    module Redirects
      def redirect_to_url_after_create
        redirect_to(@controller.send(:url_after_create))
      end

      def redirect_to_url_after_update
        redirect_to(@controller.send(:url_after_update))
      end

      def redirect_to_url_after_destroy
        redirect_to(@controller.send(:url_after_destroy))
      end
    end
  end
end

RSpec.configure do |config|
  config.include Clearance::Test::Redirects
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
clearance-2.9.3 spec/support/clearance.rb
clearance-2.9.2 spec/support/clearance.rb
clearance-2.9.1 spec/support/clearance.rb
clearance-2.9.0 spec/support/clearance.rb
clearance-2.8.0 spec/support/clearance.rb
clearance-2.7.2 spec/support/clearance.rb
clearance-2.7.0 spec/support/clearance.rb
clearance-2.6.2 spec/support/clearance.rb
clearance-2.6.1 spec/support/clearance.rb
clearance-2.6.0 spec/support/clearance.rb
clearance-2.5.0 spec/support/clearance.rb
clearance-2.4.0 spec/support/clearance.rb
clearance-2.3.1 spec/support/clearance.rb