mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-26 13:34:45 +00:00
fixed token unit test
This commit is contained in:
parent
25ae088504
commit
0960142f05
1 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ func TestToken(t *testing.T) {
|
||||||
conf := &config.Config{}
|
conf := &config.Config{}
|
||||||
conf.Session.Secret = "Otto"
|
conf.Session.Secret = "Otto"
|
||||||
ctx.Set("settings", conf)
|
ctx.Set("settings", conf)
|
||||||
ctx.Set("session", session.New(conf))
|
ctx.Set("session", session.New(conf.Session.Secret))
|
||||||
|
|
||||||
// prepare the mock
|
// prepare the mock
|
||||||
store.On("AddToken", mock.AnythingOfType("*types.Token")).Return(test.storeErr).Once()
|
store.On("AddToken", mock.AnythingOfType("*types.Token")).Return(test.storeErr).Once()
|
||||||
|
@ -102,7 +102,7 @@ func TestToken(t *testing.T) {
|
||||||
conf := &config.Config{}
|
conf := &config.Config{}
|
||||||
conf.Session.Secret = "Otto"
|
conf.Session.Secret = "Otto"
|
||||||
ctx.Set("settings", conf)
|
ctx.Set("settings", conf)
|
||||||
ctx.Set("session", session.New(conf))
|
ctx.Set("session", session.New(conf.Session.Secret))
|
||||||
|
|
||||||
// prepare the mock
|
// prepare the mock
|
||||||
store.On("TokenLabel", mock.AnythingOfType("*types.User"), test.inLabel).Return(test.outToken, test.errTokenLabel).Once()
|
store.On("TokenLabel", mock.AnythingOfType("*types.User"), test.inLabel).Return(test.outToken, test.errTokenLabel).Once()
|
||||||
|
|
Loading…
Reference in a new issue