elixir-maru / maru

Elixir RESTful Framework
https://maru.readme.io
BSD 3-Clause "New" or "Revised" License
1.32k stars 85 forks source link

Top Middleware not executing during tests #62

Closed jmnsf closed 7 years ago

jmnsf commented 7 years ago

Plugs mounted in a parent router aren't being run on the child routers during tests. I could work up a test case but there's one in the docs: the second code sample in this page doesn't pass.

  1) test / (API.MountedTest)
     test/random_mix_test.exs:28
     ** (KeyError) key :maru_plug_test not found in: %{maru_params: %{}, maru_test: true, maru_version: nil}
     stacktrace:
       test/random_mix_test.exs:30: (test)
falood commented 7 years ago

Hi @jmnsf I built many "magic" in unittest of maru, but it seems not easy to use, so I have to revert them. The latest modifies are in master brunch, I'll bump a new version soon. before the new release, I help to fix unittest of your project legacy with master version, could you please take a look whether it's good for you? Thanks.

jmnsf commented 7 years ago

It's working great, thank you @falood :)

falood commented 7 years ago

@jmnsf can you also help to check https://github.com/elixir-maru/maru/issues/55 ? Thanks