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

cannot invoke remote function Phoenix.ConnTest.redirected_to/1 inside match #40

Closed
nelsonic opened this issue Feb 26, 2017 · 2 comments
Closed

Comments

@nelsonic
Copy link
Member

trying to follow the code on p.140 of Programming Phoenix book
and there's a test that checks that the page has been redirected to a given url.
but when we attempt to run the tests we see:
image

Full output:

** (CompileError) test/controllers/video_controller_test.exs:55: cannot invoke remote function Phoenix.ConnTest.redirected_to/1 inside match
    (stdlib) lists.erl:1354: :lists.mapfoldl/3
    (stdlib) lists.erl:1354: :lists.mapfoldl/3
    test/controllers/video_controller_test.exs:53: (module)

21:51:47.736 [error] GenServer #PID<0.177.0> terminating
** (CompileError) test/controllers/video_controller_test.exs:55: cannot invoke remote function Phoenix.ConnTest.redirected_to/1 inside match
    (elixir) src/elixir_translator.erl:279: :elixir_translator.translate/2
    (stdlib) lists.erl:1354: :lists.mapfoldl/3
    (elixir) src/elixir_clauses.erl:26: :elixir_clauses.match/3
    (elixir) src/elixir_clauses.erl:35: :elixir_clauses.clause/6
    (elixir) src/elixir_clauses.erl:83: anonymous fn/3 in :elixir_clauses.do_clauses/3
    (stdlib) lists.erl:1354: :lists.mapfoldl/3
    (elixir) src/elixir_clauses.erl:88: :elixir_clauses.do_clauses/3
    (elixir) src/elixir_clauses.erl:73: :elixir_clauses.clauses/3
    (elixir) src/elixir_translator.erl:95: :elixir_translator.translate/2
    (elixir) src/elixir_translator.erl:16: :elixir_translator.translate/2
    (elixir) src/elixir_translator.erl:374: :elixir_translator.translate_block/3
    (elixir) src/elixir_translator.erl:38: :elixir_translator.translate/2
    (elixir) src/elixir_clauses.erl:36: :elixir_clauses.clause/6
    (elixir) src/elixir_def.erl:170: :elixir_def.translate_clause/7
    (elixir) src/elixir_def.erl:159: :elixir_def.translate_definition/8
    (elixir) src/elixir_def.erl:94: :elixir_def.store_definition/10
    test/controllers/video_controller_test.exs:53: (module)
    (elixir) src/elixir_compiler.erl:125: :elixir_compiler.dispatch_loaded/6
    (elixir) src/elixir_module.erl:192: :elixir_module.eval_form/6
    (elixir) src/elixir.erl:223: :elixir.erl_eval/3
@Danwhy
Copy link
Member

Danwhy commented Mar 28, 2017

Looks like a typo on that test:
assert redirected_to(conn) = video_path(conn, :index) should be:
assert redirected_to(conn) == video_path(conn, :index)

@nelsonic
Copy link
Member Author

@Danwhy thanks for confirming. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants