Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Add more admin tests #1754

Merged
merged 1 commit into from
Feb 2, 2021
Merged

Add more admin tests #1754

merged 1 commit into from
Feb 2, 2021

Conversation

sethvargo
Copy link
Member

This increases the test coverage on the admin pages significantly. There's still quite a few cases that are very difficult to test though.

Release Note

Add more admin tests

@googlebot googlebot added the cla: yes Auto: added by CLA bot when all committers have signed a CLA. label Feb 2, 2021
@@ -29,6 +29,12 @@ func (c *Controller) HandleUsersIndex() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()

session := controller.SessionFromContext(ctx)
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to duplicate this for every handler? Middleware shouldn't let you past RequireAuth without session?

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 don't, and it's a lot of repetition, but it's specifically checking to make sure we don't panic if the middleware is not installed correctly.

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sethvargo, whaught

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-robot google-oss-robot merged commit e5bf416 into main Feb 2, 2021
@google-oss-robot google-oss-robot deleted the sethvargo/admin_tests branch February 2, 2021 20:31
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Auto: added by CLA bot when all committers have signed a CLA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants