Skip to content

Instantly share code, notes, and snippets.

@shankardevy

shankardevy/crm_test.exs Secret

Created Jul 8, 2017
Embed
What would you like to do?
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