elixir-maru / maru

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

Phoenix.Conn tests fail when after upgrading 1.0 #29

Closed venkatd closed 8 years ago

venkatd commented 8 years ago

I'm not able to use Phoenix.Conn() when running my tests anymore if I upgrade to 1.0. The endpoints work-- I can run the server and test them in my browser. It's just that when I use ConnCase it doesn't work.

If this is expected, any ideas why this would stop working?

If not, I can dig in further to figure out why.

I prefer to use Phoenix.ConnCase to keep a consistent way of testing the endpoints as a couple API endpoints are done with controllers.

Thanks!

falood commented 8 years ago

Do you means version 0.10? That's expected. test env is quite different with others, and maru generate different functions for test. as a result, you can't use it as through a browser. But, I think you can do little additional work to make your test working. maru do test like this https://github.com/falood/maru/blob/v0.10.1/lib/maru/test.ex, maybe it's helpful for you. And also, I'll try to do it for you if you could show me your test code.

venkatd commented 8 years ago

Hi @falood sorry for the delay got sidetracked with other things. Here is how my ConnTest module looks: https://gist.github.com/venkatd/36200a0239c3a06f623e6b7d9cd22295

I use import Turtle.ConnTest in my api calls. Thanks!