File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
test/lib/code_corps/github/sync Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ defmodule CodeCorps.GitHub.SyncTest do
44 use CodeCorps.DbAccessCase
55
66 import CodeCorps.GitHub.TestHelpers
7+ import Ecto.Query , only: [ where: 3 ]
78
89 alias CodeCorps . {
910 Comment ,
@@ -193,14 +194,18 @@ defmodule CodeCorps.GitHub.SyncTest do
193194 assert Repo . aggregate ( Task , :count , :id ) == 3
194195 assert Repo . aggregate ( User , :count , :id ) == 2
195196
196- % TaskList { tasks: done_tasks } =
197- TaskList |> Repo . get_by ( done: true ) |> Repo . preload ( :tasks )
197+ # Tasks closed more than 30 days ago
198+ archived_tasks =
199+ Task
200+ |> where ( [ object ] , is_nil ( object . task_list_id ) )
201+ |> Repo . all ( )
202+
198203 % TaskList { tasks: inbox_tasks } =
199204 TaskList |> Repo . get_by ( inbox: true ) |> Repo . preload ( :tasks )
200205 % TaskList { tasks: pull_requests_tasks } =
201206 TaskList |> Repo . get_by ( pull_requests: true ) |> Repo . preload ( :tasks )
202207
203- assert Enum . count ( done_tasks ) == 1
208+ assert Enum . count ( archived_tasks ) == 1
204209 assert Enum . count ( inbox_tasks ) == 1
205210 assert Enum . count ( pull_requests_tasks ) == 1
206211 end
You can’t perform that action at this time.
0 commit comments