Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .city instead of [:city] in history test #20

Open
geekoftheweek opened this issue Dec 29, 2018 · 1 comment
Open

Use .city instead of [:city] in history test #20

geekoftheweek opened this issue Dec 29, 2018 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@geekoftheweek
Copy link
Contributor

In the get history of an item test, I got the following:

     test/append/address_test.exs:56
     ** (UndefinedFunctionError) function Append.Address.fetch/2 is undefined (Append.Address does not implement the Access behaviour)
     code: assert h1[:city] == "Asgard"
     stacktrace:
       (append) Append.Address.fetch(%Append.Address{__meta__: #Ecto.Schema.Metadata<:loaded, "addresses">, address_line_1: "The Hall", address_line_2: "Valhalla", city: "Asgard", entry_id: "b0cccc58-f3ea-4b9d-9b57-9b79c2bbf69a", id: 100, inserted_at: ~N[2018-12-29 20:29:29.782939], name: "Thor", postcode: "AS1 3DG", tel: "0800123123", updated_at: ~N[2018-12-29 20:29:29.782939]}, :city)
       (elixir) lib/access.ex:318: Access.get/3
       test/append/address_test.exs:70: (test)

In my own code I fixed this by changing the assert statements to check h1.city instead of h1[:city] (and likewise for h2).

@nelsonic nelsonic added the help wanted Extra attention is needed label Dec 30, 2018
@nelsonic
Copy link
Member

@geekoftheweek that would be a good fix/improvement. would you mind creating a Pull Request?
(please/thanks!)

geekoftheweek added a commit to geekoftheweek/phoenix-ecto-append-only-log-example that referenced this issue Dec 31, 2018
Changing the `[:city]` to `.city` resolves an UndefinedFunctionError as described in dwyl#20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants