Created
August 12, 2016 13:20
-
-
Save cayblood/4c992d8b862809ec501d546089edb741 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Juno.Factory do | |
use ExMachina.Ecto, repo: Juno.Repo | |
# import GoodTimes | |
# import GoodTimes.Convert | |
alias Juno.Transaction | |
alias Juno.VirtualCard | |
def transaction_factory do | |
%Transaction { | |
description: "Description", | |
amount: 10.59, | |
virtual_card: build(:virtual_card) | |
} | |
end | |
def virtual_card_factory do | |
{:ok, time} = Ecto.DateTime.cast({{2001, 2, 3}, {4, 5, 6}}) | |
%VirtualCard { | |
name: sequence("Virtual Card "), | |
external_id: sequence("external_id_"), | |
last_four: sequence("000"), | |
expires_at: time, | |
amount: 150.00, | |
transactions: build_list(2, :transaction) | |
} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment