diff options
author | Igor <idrozdov@gitlab.com> | 2019-03-21 11:53:09 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-03-21 11:53:09 +0000 |
commit | 98dbdfb758703428626d54b2a257565a44509a55 (patch) | |
tree | a3fdc408786fd0342bd3eb28ad841e70d3d7ac6e /go/internal/command/command_test.go | |
parent | 81bed658f083a165e65b16f7ef86c18938349e33 (diff) | |
download | gitlab-shell-98dbdfb758703428626d54b2a257565a44509a55.tar.gz |
Provide go implementation for 2fa_recovery_codes command
Diffstat (limited to 'go/internal/command/command_test.go')
-rw-r--r-- | go/internal/command/command_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/go/internal/command/command_test.go b/go/internal/command/command_test.go index 02fc0d0..42c5112 100644 --- a/go/internal/command/command_test.go +++ b/go/internal/command/command_test.go @@ -6,6 +6,7 @@ import ( "github.com/stretchr/testify/assert" "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/discover" "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/fallback" + "gitlab.com/gitlab-org/gitlab-shell/go/internal/command/twofactorrecover" "gitlab.com/gitlab-org/gitlab-shell/go/internal/config" "gitlab.com/gitlab-org/gitlab-shell/go/internal/testhelper" ) @@ -44,6 +45,19 @@ func TestNew(t *testing.T) { }, expectedType: &fallback.Command{}, }, + { + desc: "it returns a TwoFactorRecover command if the feature is enabled", + arguments: []string{}, + config: &config.Config{ + GitlabUrl: "http+unix://gitlab.socket", + Migration: config.MigrationConfig{Enabled: true, Features: []string{"2fa_recovery_codes"}}, + }, + environment: map[string]string{ + "SSH_CONNECTION": "1", + "SSH_ORIGINAL_COMMAND": "2fa_recovery_codes", + }, + expectedType: &twofactorrecover.Command{}, + }, } for _, tc := range testCases { |