Skip to content

Instantly share code, notes, and snippets.

@jalcine
Created July 4, 2016 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jalcine/a28f242af4da93bea18a560922227364 to your computer and use it in GitHub Desktop.
Save jalcine/a28f242af4da93bea18a560922227364 to your computer and use it in GitHub Desktop.
user = insert(:user)
insertedFilterList = insert_list(4, :filter, %{owner_user: user})
|> Enum.into([], fn filter -> filter.id end)
|> Enum.reverse
ownedFilters = Repo.preload(user, :filters).filters
|> Enum.into([], fn filter -> filter.id end)
assert ownedFilters == insertedFilterList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment