antonmi / espec_phoenix

ESpec for Phoenix web framework.
MIT License
137 stars 33 forks source link

Splat _url Helpers in Controller Tests #19

Closed baoist closed 7 years ago

baoist commented 8 years ago

Ran into the following issues when a html view is rendered in a controller test:

foo_url(Project.Endpoint, :index) # works
foo_url(@conn, :index)
# Throws the following error:
# ** (KeyError) key :phoenix_endpoint not found in: %{phoenix_controller: Project.FooContoller, 
# phoenix_flash: %{}, phoenix_format: "html", phoenix_recycled: true, phoenix_template: "show.html", 
# phoenix_view: Project.FooView, plug_session: %{}, plug_session_fetch: :done, plug_session_info: 
# :write, plug_skip_csrf_protection: true}

I wasn't able to fix this on the test/espec side of things; I had to modify my view.

walter commented 8 years ago

I'm getting the same when running view specs and using the render/2 helper. Phoenix 1.2.

walter commented 8 years ago

I verified this against laster espec_phoenix master.

antonmi commented 8 years ago

Guys, please check if the issue is actual for 0.5.0