Skip to content

Commit

Permalink
create fixture instead of putting spec in test
Browse files Browse the repository at this point in the history
  • Loading branch information
se3000 committed Jun 3, 2019
1 parent 37d29a8 commit cd42058
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 1 addition & 2 deletions core/internal/features_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,11 @@ func TestIntegration_SleepAdapter(t *testing.T) {
t.Parallel()

sleepSeconds := 3
specJSON := "{\"initiators\":[{\"type\":\"web\"}],\"tasks\":[{\"type\":\"sleep\"},{\"type\":\"noop\"}]}"
app, cleanup := cltest.NewApplication(t)
defer cleanup()
app.Start()

j := cltest.CreateSpecViaWeb(t, app, specJSON)
j := cltest.FixtureCreateJobViaWeb(t, app, "./testdata/sleep_job.json")

runInput := fmt.Sprintf("{\"until\": \"%s\"}", time.Now().Local().Add(time.Second*time.Duration(sleepSeconds)))
jr := cltest.CreateJobRunViaWeb(t, app, j, runInput)
Expand Down
9 changes: 9 additions & 0 deletions core/internal/testdata/sleep_job.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"initiators": [
{"type": "web"}
],
"tasks": [
{"type": "sleep"},
{"type": "noop"}
]
}

0 comments on commit cd42058

Please sign in to comment.