diff options
author | George Goldberg <george@gberg.me> | 2017-07-20 16:25:35 +0100 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2017-07-20 08:25:35 -0700 |
commit | 6c6f2a1138447777bbf46cc2c40e1b3c47204466 (patch) | |
tree | c2630ad79a7bc12d6c0c0233098e29d6811cb99b /app/job_test.go | |
parent | 5ae701d133f713363e52b9cc6aa01579c81ebab4 (diff) | |
download | chat-6c6f2a1138447777bbf46cc2c40e1b3c47204466.tar.gz chat-6c6f2a1138447777bbf46cc2c40e1b3c47204466.tar.bz2 chat-6c6f2a1138447777bbf46cc2c40e1b3c47204466.zip |
PLT-6595-Server: Job Management APIs. (#6931)
* PLT-6595-Server: Job Management APIs.
* MANAGE_JOBS Permission
* Fix test.
Diffstat (limited to 'app/job_test.go')
-rw-r--r-- | app/job_test.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/job_test.go b/app/job_test.go index ced65788f..8f068901a 100644 --- a/app/job_test.go +++ b/app/job_test.go @@ -10,7 +10,7 @@ import ( "github.com/mattermost/platform/store" ) -func TestGetJobStatus(t *testing.T) { +func TestGetJob(t *testing.T) { Setup() status := &model.Job{ @@ -30,7 +30,7 @@ func TestGetJobStatus(t *testing.T) { } } -func TestGetJobStatusesByType(t *testing.T) { +func TestGetJobByType(t *testing.T) { Setup() jobType := model.NewId() @@ -39,17 +39,17 @@ func TestGetJobStatusesByType(t *testing.T) { { Id: model.NewId(), Type: jobType, - StartAt: 1000, + CreateAt: 1000, }, { Id: model.NewId(), Type: jobType, - StartAt: 999, + CreateAt: 999, }, { Id: model.NewId(), Type: jobType, - StartAt: 1001, + CreateAt: 1001, }, } @@ -62,7 +62,7 @@ func TestGetJobStatusesByType(t *testing.T) { t.Fatal(err) } else if len(received) != 2 { t.Fatal("received wrong number of statuses") - } else if received[0].Id != statuses[1].Id { + } else if received[0].Id != statuses[2].Id { t.Fatal("should've received newest job first") } else if received[1].Id != statuses[0].Id { t.Fatal("should've received second newest job second") @@ -72,7 +72,7 @@ func TestGetJobStatusesByType(t *testing.T) { t.Fatal(err) } else if len(received) != 1 { t.Fatal("received wrong number of statuses") - } else if received[0].Id != statuses[2].Id { + } else if received[0].Id != statuses[1].Id { t.Fatal("should've received oldest job last") } } |