Skip to content

Commit

Permalink
update test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Qi He committed May 12, 2016
1 parent 6e73a2a commit 723c8ae
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/ueberauth/strategy/weibo/oauth_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,18 @@ defmodule Ueberauth.Strategy.Weibo.OAuthTest do
assert client.token_url == "/oauth2/access_token"
assert client.site == "https://api.weibo.com"
end

test "get_access_token with error from new token" do
access_token = %OAuth2.AccessToken{access_token: "token"}
token = access_token |> get_access_token("", %{"error" => ""})
assert token.access_token == "token"
end

test "get_access_token with params in `other_params`", %{client: client} do
access_token = OAuth2.AccessToken.new(%{
"{\"access_token\":\"token\"}" => nil
}, client)
token = access_token |> get_access_token(nil, nil)
assert token.access_token == "token"
end
end

0 comments on commit 723c8ae

Please sign in to comment.