Skip to content

Commit

Permalink
add test to cover HTTPoisonMock functions #44
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Apr 3, 2020
1 parent f70a95e commit 72f749e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/elixir_auth_github_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,19 @@ defmodule ElixirAuthGithubTest do

test "github_auth returns a user and token" do
setup_test_environment_variables()

assert ElixirAuthGithub.github_auth("12345") ==
{:ok, %{:access_token => "12345", :login => "test_user"}}
end

test "github_auth returns an error with a bad code" do
setup_test_environment_variables()

assert ElixirAuthGithub.github_auth("1234") ==
{:error, %{"error" => "error"}}
end

test "github_auth returns an error with a bad code 123" do
setup_test_environment_variables()
assert ElixirAuthGithub.github_auth("123") ==
{:error, %{"error" => "error"}}
end
end

0 comments on commit 72f749e

Please sign in to comment.