Browse Source

Add missing fixture to clean gpg_key table (#2494)

* Add missing fixture to clean gpg_key table

* Fix possible too fast request execution in timetracker start/stop test
Lauris BH 1 year ago
parent
commit
8c3a2e817b
2 changed files with 5 additions and 0 deletions
  1. 4 0
      integrations/timetracking_test.go
  2. 1 0
      models/fixtures/gpg_key.yml

+ 4 - 0
integrations/timetracking_test.go

@@ -8,6 +8,7 @@ import (
8 8
 	"net/http"
9 9
 	"path"
10 10
 	"testing"
11
+	"time"
11 12
 
12 13
 	"github.com/stretchr/testify/assert"
13 14
 )
@@ -56,6 +57,9 @@ func testViewTimetrackingControls(t *testing.T, session *TestSession, user, repo
56 57
 		htmlDoc.AssertElement(t, ".timetrack .stop-cancel .stop", true)
57 58
 		htmlDoc.AssertElement(t, ".timetrack .stop-cancel .cancel", true)
58 59
 
60
+		// Sleep for 1 second to not get wrong order for stopping timer
61
+		time.Sleep(time.Second)
62
+
59 63
 		req = NewRequestWithValues(t, "POST", path.Join(user, repo, "issues", issue, "times", "stopwatch", "toggle"), map[string]string{
60 64
 			"_csrf": htmlDoc.GetCSRF(),
61 65
 		})

+ 1 - 0
models/fixtures/gpg_key.yml

@@ -0,0 +1 @@
1
+[] # empty