Queuetopia.Test.Assertions (queuetopia v2.7.1)

View Source

Summary

Functions

assert_job_created(queuetopia, job_attrs \\ %{})

Asserts the job has juste been created

It can be used as below:

# Examples

  job = MyQueuetopia.create_job("mailer_queue", "deliver_mail", %{body: "hello", from: "from", to: "to"})

  assert_job_created(MyQueuetopia)
  assert_job_created(MyQueuetopia, 1)
  assert_job_created(MyQueuetopia, %{queue: "mailer_queue", params: %{body: "hello"}})
  assert_job_created(MyQueuetopia, 2, %{action: "deliver_email", params: %{body: "hello"}})

assert_job_created(queuetopia, expected_count, job_attrs)

jobs_created(queuetopia, job_attrs \\ %{})

Find jobs that have just been created

It can be used as below:

# Examples

  MyQueuetopia.create_job("mailer_queue", "deliver_mail", %{body: "hello", from: "from", to: "to"})

  assert [job] = jobs_created(MyQueuetopia)

refute_job_created(queuetopia, job_attrs \\ %{})

Refute that a job has been created.

It can be used as below:

# Examples

  job = MyQueuetopia.create_job("mailer_queue", "deliver_mail", %{body: "hello", from: "from", to: "to"})

  refute_job_created(MyQueuetopia)
  refute_job_created(MyQueuetopia, %{queue: "mailer_queue", params: %{body: "hello"}})