Skip to content

Instantly share code, notes, and snippets.

@lasseebert
Last active October 17, 2016 20:10
Show Gist options
  • Select an option

  • Save lasseebert/c6133a54e6fd2e79def45011bb7a2f1b to your computer and use it in GitHub Desktop.

Select an option

Save lasseebert/c6133a54e6fd2e79def45011bb7a2f1b to your computer and use it in GitHub Desktop.
defmodule MyApp.Users.InviteTest do
use MyApp.ModelCase
alias MyApp.Users.Invite
alias MyApp.User
test "it creates a user" do
{:ok, user} = Invite.call(%{email: "alice@example.com"})
assert user.id > 0
assert user.email == "alice@example.com"
assert (from u in User, select: count(u.id)) |> Repo.one == 1
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment