afternow

afternow

"expected ExUnit callback" while running Absinthe Tests

Hello

I create a graphql API according to the book “Craft graphql apis in elixir with absinthe”.

When I create tests, I run into an error:

  1) test Category field returns category items (BiidiWeb.Schema.Query.CategoryTest)
 test/biidi_web/schema/query/category_test.ex:15
 ** (RuntimeError) expected ExUnit callback in BiidiWeb.Schema.Query.CategoryTest to return :ok | keyword | map, got %Biidi.Category{__meta

__: #Ecto.Schema.Metadata<:loaded, “categories”>, id: 4, inserted_at: ~N[2018-09-18 20:19:16.469878], title: “other”, updated_at: ~N[2018-09-18
20:19:16.469890]} instead
stacktrace:
(ex_unit) lib/ex_unit/callbacks.ex:368: ExUnit.Callbacks.raise_merge_failed!/2

I searched in Google and in the Forum, but cause I’m new in Elixir and Phoenix I don’t get a propper understanding of the occurring issue.

Here is a working dockerized copy reduced to the failing part:
https://gitlab.com/birdnestman/biidi_test

You can run docker-compose, create DB, migration and then run the test…

Thank you for any help!

Marked As Solved

afternow

afternow

Got it. The error appears in the “setup do”

I forgot to add
“:ok”
to the end of the seeds file…

Also Liked

ijunaidfarooq

ijunaidfarooq

life saver.

Where Next?

Popular in Questions Top

aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
nobody
How to bind a phoenix app to a specific ip address? could not find anything about that, nowhere, unfortunately, but for me this is quite...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a &gt; b) do {:ok, "a"} end if (a &lt; b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39297 209
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
marick
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I’m a nov...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

We're in Beta

About us Mission Statement