Skip to content

Commit

Permalink
AC::TestResponse becomes AD::TestResponse in Rails v5
Browse files Browse the repository at this point in the history
  • Loading branch information
maclover7 committed Feb 12, 2017
1 parent 1289157 commit 3ffc3ec
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions spec/controllers/authorizations_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,22 @@
describe Doorkeeper::AuthorizationsController, 'implicit grant flow' do
include AuthorizationRequestHelper

class ActionController::TestResponse
def query_params
@_query_params ||= begin
fragment = URI.parse(location).fragment
Rack::Utils.parse_query(fragment)
if Rails::VERSION::MAJOR == 5
class ActionDispatch::TestResponse
def query_params
@_query_params ||= begin
fragment = URI.parse(location).fragment
Rack::Utils.parse_query(fragment)
end
end
end
else
class ActionController::TestResponse
def query_params
@_query_params ||= begin
fragment = URI.parse(location).fragment
Rack::Utils.parse_query(fragment)
end
end
end
end
Expand Down

0 comments on commit 3ffc3ec

Please sign in to comment.