Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send Email #17

Merged
merged 15 commits into from
Mar 29, 2020
Merged

Send Email #17

merged 15 commits into from
Mar 29, 2020

Conversation

nelsonic
Copy link
Member

@SimonLab this PR sends a welcome email to people who authenticate with Google/GitHub.

@codecov
Copy link

codecov bot commented Mar 27, 2020

Codecov Report

Merging #17 into master will increase coverage by 12.50%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           master       #17       +/-   ##
============================================
+ Coverage   87.50%   100.00%   +12.50%     
============================================
  Files          18        16        -2     
  Lines          72        70        -2     
============================================
+ Hits           63        70        +7     
+ Misses          9         0        -9     
Impacted Files Coverage Δ
lib/auth_mvp/email.ex 100.00% <100.00%> (ø)
...auth_mvp_web/controllers/github_auth_controller.ex 100.00% <100.00%> (+14.28%) ⬆️
...auth_mvp_web/controllers/google_auth_controller.ex 100.00% <100.00%> (+12.50%) ⬆️
lib/auth_mvp_web.ex
lib/auth_mvp/application.ex
lib/auth_mvp_web/views/error_helpers.ex

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 33af8ec...7848e56. Read the comment docs.

@nelsonic
Copy link
Member Author

@SimonLab as you can see from the Codecov Coverage report, coverage is still below 100% 🙄
but at least the code added in this PR does not push it down. 😉

To get this working on Heroku you will need to have the two environment variables defined (as per the instructions in the README.md) you can get the SECRET_KEY_BASE from https://dashboard.heroku.com/apps/dwylmail/settings (which I shared access with you earlier today).

Let me know if anything is unclear or you have any questions.
Thanks! ☀️

@@ -3,6 +3,9 @@
"minimum_coverage": 100
},
"skip_files": [
"test/"
"test/",
"lib/auth_mvp_web.ex",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we aren't directly using these files so they aren't covered by tests hence adding them here.

@@ -28,3 +28,6 @@ config :phoenix, :json_library, Jason
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"

# https://hexdocs.pm/joken/introduction.html#usage
config :joken, default_signer: System.get_env("SECRET_KEY_BASE")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to match the SECRET_KEY_BASE on dashboard.heroku.com/apps/dwylmail/settings for email to work.

@@ -4,5 +4,9 @@ defmodule AuthMvpWeb.GithubAuthControllerTest do
test "GET /auth/github/callback", %{conn: conn} do
conn = get(conn, Routes.github_auth_path(conn, :index, %{code: "123", state: "http://localhost/"}))
assert html_response(conn, 302)

# same again to exercise to the branch where person already exists:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you were already so close to 100% coverage that I just added these extra lines to get to 💯
(hope you don't mind ...)

@nelsonic
Copy link
Member Author

@SimonLab please excuse the flood of commits tidying up ... 🙄
Hope everything is clear. 👍

Copy link
Member

@SimonLab SimonLab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks @nelsonic

@SimonLab SimonLab merged commit f027488 into master Mar 29, 2020
@SimonLab SimonLab deleted the send-email-issue#41 branch March 29, 2020 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants