Skip to content

Commit

Permalink
final configuration ready for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Jul 15, 2016
1 parent 1fbccdd commit f2f5d59
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion example/config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ config :example, Repo,
password: "postgres",
database: "paper_trail_example_test",
hostname: "localhost",
pool: Ecto.Adapters.SQL.Sandbox
poolsize: 10
12 changes: 8 additions & 4 deletions example/test/company_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@ defmodule CompanyTest do

doctest Company

test "creating a company creates a company version with correct attributes" do
setup_all do
Repo.delete_all(Company)
Repo.delete_all(PaperTrail.Version)
:ok
end

# Mix.env |> inspect |> IO.puts
test "creating a company creates a company version with correct attributes" do
new_company = Company.changeset(%Company{}, %{
name: "Acme LLC", is_active: true, city: "Greenwich"
})

persisted_company = PaperTrail.insert(new_company)
{:ok, persisted_company} = PaperTrail.insert(new_company)

persisted_company |> inspect |> IO.puts

Expand All @@ -21,8 +25,8 @@ defmodule CompanyTest do
)

assert company_count == [1]

# assert Map.
# company |> inspect |> IO.puts

end

Expand Down
2 changes: 1 addition & 1 deletion example/test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ExUnit.start()
ExUnit.start
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ defmodule PaperTrail.Mixfile do

defp description do
"""
PaperTrail lets you track and record all the changes in your database.
Track and record all the changes in your database with PaperTrail.
"""
end

Expand Down

0 comments on commit f2f5d59

Please sign in to comment.