test/oauth/access_grant_test.rb in rack-oauth2-server-1.3.1 vs test/oauth/access_grant_test.rb in rack-oauth2-server-1.4.0
- old
+ new
@@ -61,10 +61,11 @@
super
# Get authorization code.
params = { :redirect_uri=>client.redirect_uri, :client_id=>client.id, :client_secret=>client.secret, :response_type=>"code",
:scope=>"read write", :state=>"bring this back" }
get "/oauth/authorize?" + Rack::Utils.build_query(params)
- post "/oauth/grant"
+ authorization = last_response.body[/authorization:\s*(\S+)/, 1]
+ post "/oauth/grant", :authorization=>authorization
@code = Rack::Utils.parse_query(URI.parse(last_response["Location"]).query)["code"]
end
def request_access_token(changes = nil)
params = { :client_id=>client.id, :client_secret=>client.secret, :scope=>"read write",