allow specifying custom state key-values (#218)

This commit is contained in:
Piotr Usewicz authored and Graham Paye committed 2019-06-10 11:21:11 -07:00
1 parent f2f83b20bc
commit 9e797f13b8
2 files changed
+14 -4

No files matched your search

@@ -63,6 +63,12 @@ describe Google::Auth::WebUserAuthorizer do
)
end
it "should allow adding custom state key-value pairs" do
url = authorizer.get_authorization_url request: request, state: { james: "bond", kind: 1 }
expect(url).to match(%r{%22james%22:%22bond%22})
expect(url).to match(%r{%22kind%22:1})
end
it "should include request forgery token in state" do
expect(SecureRandom).to receive(:base64).and_return("aGVsbG8=")
url = authorizer.get_authorization_url request: request