Skip to content

Instantly share code, notes, and snippets.

@paulcsmith
Last active August 29, 2015 14:27
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 paulcsmith/160112849fbd8052bed6 to your computer and use it in GitHub Desktop.
Save paulcsmith/160112849fbd8052bed6 to your computer and use it in GitHub Desktop.
defmodule MyApp.Fixtures do
alias MyApp.Repo
alias MyApp.User
def fixture(:user) do
%User{name: "Daniel Berkompas", email: "test@example.com"}
end
# Example: create(:user)
def create(record) do
Repo.insert! fixture(record)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment