Skip to content

Instantly share code, notes, and snippets.

@shankardevy
Created July 8, 2017 04:05
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 shankardevy/691b7f4dede5a8418673ddfa98c6aa73 to your computer and use it in GitHub Desktop.
Save shankardevy/691b7f4dede5a8418673ddfa98c6aa73 to your computer and use it in GitHub Desktop.
defmodule Mango.CRMTest do
use Mango.DataCase
alias Mango.CRM
alias Mango.CRM.Customer
test "build_customer/0 returns a customer changeset" do
assert %Ecto.Changeset{data: %Customer{}} = CRM.build_customer
end
test "build_customer/1 returns a customer changeset with values applied" do
attrs = %{"name" => "John"}
changeset = CRM.build_customer(attrs)
assert changeset.params == attrs
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment