summaryrefslogtreecommitdiff
path: root/plugins/jobs/job_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jobs/job_test.go')
-rw-r--r--plugins/jobs/job_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/jobs/job_test.go b/plugins/jobs/job_test.go
new file mode 100644
index 00000000..e1938eca
--- /dev/null
+++ b/plugins/jobs/job_test.go
@@ -0,0 +1,18 @@
+package jobs
+
+import (
+ "github.com/stretchr/testify/assert"
+ "testing"
+)
+
+func TestJob_Body(t *testing.T) {
+ j := &Job{Payload: "hello"}
+
+ assert.Equal(t, []byte("hello"), j.Body())
+}
+
+func TestJob_Context(t *testing.T) {
+ j := &Job{Job: "job"}
+
+ assert.Equal(t, []byte(`{"id":"id","job":"job"}`), j.Context("id"))
+}