aboutsummaryrefslogtreecommitdiffstats
path: root/commands/add_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'commands/add_test.go')
-rw-r--r--commands/add_test.go19
1 files changed, 9 insertions, 10 deletions
diff --git a/commands/add_test.go b/commands/add_test.go
index b85c7fa2..63eda06e 100644
--- a/commands/add_test.go
+++ b/commands/add_test.go
@@ -1,4 +1,4 @@
-package commands_test
+package commands
import (
"strings"
@@ -11,15 +11,14 @@ func newTestEnvUserAndBug(t *testing.T) (*testEnv, string, string) {
t.Helper()
testEnv, userID := newTestEnvAndUser(t)
-
- testEnv.cmd.SetArgs([]string{
- "add",
- "--non-interactive",
- "-t 'this is a bug title'",
- "-m 'this is a bug message'",
- })
-
- testEnv.Execute(t)
+ opts := addOptions{
+ title: "this is a bug title",
+ message: "this is a bug message",
+ messageFile: "",
+ nonInteractive: true,
+ }
+
+ require.NoError(t, runAdd(testEnv.env, opts))
require.Regexp(t, "^[0-9A-Fa-f]{7} created\n$", testEnv.out)
bugID := strings.Split(testEnv.out.String(), " ")[0]
testEnv.out.Reset()