Skip to content

Commit

Permalink
update auth_helper to use the hash format for process
Browse files Browse the repository at this point in the history
  • Loading branch information
Chocksy committed Jul 8, 2016
1 parent 418bf60 commit 955a7a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion spec/support/auth_helper.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Authorization
def request_with(user, http_method, action, parameters = {}, session = {}, flash = {} )
warden.set_user user
process action, http_method.to_s.upcase, parameters, session, flash
process action, method: http_method.to_s.upcase, params: parameters, session: session, flash: flash
end

[:get, :put, :post, :delete].each do |method|
Expand Down
10 changes: 5 additions & 5 deletions spec/support/warden.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ def _catch_warden(&block)
if result.is_a?(Hash) && !warden.custom_failure? && !@controller.send(:performed?)
result[:action] ||= :unauthenticated

env = @controller.request.env
env['PATH_INFO'] = "/#{result[:action]}"
env['warden.options'] = result
Warden::Manager._run_callbacks(:before_failure, env, result)
request_env = @controller.request.env
request_env['PATH_INFO'] = "/#{result[:action]}"
request_env['warden.options'] = result
Warden::Manager._run_callbacks(:before_failure, request_env, result)

status, headers, body = warden.config[:failure_app].call(env).to_a
status, headers, body = warden.config[:failure_app].call(request_env).to_a
@controller.send :render, :status => status, :text => body,
:content_type => headers['Content-Type'], :location => headers['Location']

Expand Down

0 comments on commit 955a7a9

Please sign in to comment.