Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
f3c52710
Commit
f3c52710
authored
Mar 14, 2019
by
Sean Lafferty
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make recently used auth_module test more robust by adding another 'log in'
parent
fcc18d81
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
1 deletions
+18
-1
pkg/services/sqlstore/user_auth_test.go
+18
-1
No files found.
pkg/services/sqlstore/user_auth_test.go
View file @
f3c52710
...
...
@@ -175,7 +175,7 @@ func TestUserAuth(t *testing.T) {
login
:=
"loginuser0"
// Calling GetUserByAuthInfoQuery on an existing user will populate an entry in the user_auth table
query
:=
&
m
.
GetUserByAuthInfoQuery
{
Login
:
login
,
AuthModule
:
"test
"
,
AuthId
:
"test
"
}
query
:=
&
m
.
GetUserByAuthInfoQuery
{
Login
:
login
,
AuthModule
:
"test
1"
,
AuthId
:
"test1
"
}
err
=
GetUserByAuthInfo
(
query
)
So
(
err
,
ShouldBeNil
)
...
...
@@ -200,6 +200,23 @@ func TestUserAuth(t *testing.T) {
So
(
err
,
ShouldBeNil
)
So
(
getAuthQuery
.
Result
.
AuthModule
,
ShouldEqual
,
"test2"
)
// "log in" again with the first auth module
// resolution of `Created` column is 1sec, so we need a delay
time
.
Sleep
(
time
.
Second
)
updateAuthCmd
:=
&
m
.
UpdateAuthInfoCommand
{
UserId
:
query
.
Result
.
Id
,
AuthModule
:
"test1"
,
AuthId
:
"test1"
}
err
=
UpdateAuthInfo
(
updateAuthCmd
)
So
(
err
,
ShouldBeNil
)
// Get the latest entry by not supply an authmodule or authid
getAuthQuery
=
&
m
.
GetAuthInfoQuery
{
UserId
:
query
.
Result
.
Id
,
}
err
=
GetAuthInfo
(
getAuthQuery
)
So
(
err
,
ShouldBeNil
)
So
(
getAuthQuery
.
Result
.
AuthModule
,
ShouldEqual
,
"test1"
)
})
})
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment