class CustomStrategy

These tests are to prove that a warden strategy can successfully return a custom response, including a specific status code and custom http response headers. This does work in production, however, at the time of writing this, the Devise test helpers do not recognise the custom response and proceed to calling the Failure App. This makes it impossible to write tests for a strategy that return a custom response with Devise.

Public Instance Methods

authenticate!() click to toggle source
# File test/controllers/custom_strategy_test.rb, line 20
def authenticate!
  custom_headers = { "X-FOO" => "BAR" }
  response = Rack::Response.new("BAD REQUEST", 400, custom_headers)
  custom! response.finish
end