-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from pow-auth/ensure-user-map-is-returned
Ensure returned body for fetch_user is a map
- Loading branch information
Showing
4 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -320,6 +320,18 @@ defmodule Assent.Strategy.OAuth2Test do | |
assert error.response.body == %{"error" => "Unauthorized"} | ||
end | ||
|
||
test "with `:user_url` not returning decoded map in body", %{ | ||
config: config, | ||
callback_params: params | ||
} do | ||
expect_oauth2_access_token_request() | ||
expect_oauth2_user_request("%") | ||
|
||
assert {:error, %UnexpectedResponseError{} = error} = OAuth2.callback(config, params) | ||
assert Exception.message(error) =~ "An unexpected response was received." | ||
assert error.response.body == "%" | ||
end | ||
|
||
@user_api_params %{name: "Dan Schultzer", email: "[email protected]", uid: "1"} | ||
|
||
test "with no auth method", %{config: config, callback_params: params} do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters