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

Tutorial issue #18

Closed
mnapoleon opened this issue Apr 22, 2016 · 8 comments
Closed

Tutorial issue #18

mnapoleon opened this issue Apr 22, 2016 · 8 comments

Comments

@mnapoleon
Copy link

Work through whole tutorial on website and everything worked great expect that step for test.
Updated code to match that on website for test and got following error....

lein test guestbook.test.handler

lein test :only guestbook.test.handler/test-app

ERROR in (test-app) (AFn.java:429)
Uncaught exception, not in assertion.
expected: nil
actual: clojure.lang.ArityException: Wrong number of args (1) passed to: handler/app
at clojure.lang.AFn.throwArity (AFn.java:429)
clojure.lang.AFn.invoke (AFn.java:32)
guestbook.test.handler$fn__16685$fn__16686.invoke (handler.clj:8)
guestbook.test.handler$fn__16685.invokeStatic (handler.clj:7)
guestbook.test.handler/fn (handler.clj:6)
clojure.test$test_var$fn__7983.invoke (test.clj:716)
clojure.test$test_var.invokeStatic (test.clj:716)
clojure.test$test_var.invoke (test.clj:707)
clojure.test$test_vars$fn__8005$fn__8010.invoke (test.clj:734)
clojure.test$default_fixture.invokeStatic (test.clj:686)
clojure.test$default_fixture.invoke (test.clj:682)
clojure.test$test_vars$fn__8005.invoke (test.clj:734)
clojure.test$default_fixture.invokeStatic (test.clj:686)
clojure.test$default_fixture.invoke (test.clj:682)
clojure.test$test_vars.invokeStatic (test.clj:730)
clojure.test$test_all_vars.invokeStatic (test.clj:736)
clojure.test$test_ns.invokeStatic (test.clj:757)
clojure.test$test_ns.invoke (test.clj:742)
clojure.core$map$fn__4785.invoke (core.clj:2646)
clojure.lang.LazySeq.sval (LazySeq.java:40)
clojure.lang.LazySeq.seq (LazySeq.java:49)
clojure.lang.Cons.next (Cons.java:39)
clojure.lang.RT.boundedLength (RT.java:1749)
clojure.lang.RestFn.applyTo (RestFn.java:130)
clojure.core$apply.invokeStatic (core.clj:648)
clojure.test$run_tests.invokeStatic (test.clj:767)
clojure.test$run_tests.doInvoke (test.clj:767)
clojure.lang.RestFn.applyTo (RestFn.java:137)
clojure.core$apply.invokeStatic (core.clj:646)
clojure.core$apply.invoke (core.clj:641)
user$eval16487$fn__16546$fn__16577.invoke (form-init1620404423580901960.clj:1)
user$eval16487$fn__16546$fn__16547.invoke (form-init1620404423580901960.clj:1)
user$eval16487$fn__16546.invoke (form-init1620404423580901960.clj:1)
user$eval16487.invokeStatic (form-init1620404423580901960.clj:1)
user$eval16487.invoke (form-init1620404423580901960.clj:1)
clojure.lang.Compiler.eval (Compiler.java:6927)
clojure.lang.Compiler.eval (Compiler.java:6917)
clojure.lang.Compiler.load (Compiler.java:7379)
clojure.lang.Compiler.loadFile (Compiler.java:7317)
clojure.main$load_script.invokeStatic (main.clj:275)
clojure.main$init_opt.invokeStatic (main.clj:277)
clojure.main$init_opt.invoke (main.clj:277)
clojure.main$initialize.invokeStatic (main.clj:308)
clojure.main$null_opt.invokeStatic (main.clj:342)
clojure.main$null_opt.invoke (main.clj:339)
clojure.main$main.invokeStatic (main.clj:421)
clojure.main$main.doInvoke (main.clj:384)
clojure.lang.RestFn.invoke (RestFn.java:421)
clojure.lang.Var.invoke (Var.java:383)
clojure.lang.AFn.applyToHelper (AFn.java:156)
clojure.lang.Var.applyTo (Var.java:700)
clojure.main.main (main.java:37)

@yogthos
Copy link
Member

yogthos commented Apr 22, 2016

Hi thanks for noticing, that's a bug on my part. I recently changed the app handler to be a function to address this issue luminus-framework/luminus-template#220 and forgot to update the tests. I just pushed out a new version with the fix. You can see the change here luminus-framework/luminus-template@f602989

@yogthos
Copy link
Member

yogthos commented Apr 22, 2016

I'll close this one, but let me know if you find anything else.

@yogthos yogthos closed this as completed Apr 22, 2016
@mnapoleon
Copy link
Author

Thanks. All looks good now.

@tafenton
Copy link

tafenton commented Nov 7, 2017

Hi,
I've just hit this issue - your sample code for deploying SSL (http://www.luminusweb.net/docs/deployment.md#setting_up_ssl) contains the old-style app handler {:handler handler/app}.
Everything else so far looks great!

@yogthos
Copy link
Member

yogthos commented Nov 7, 2017

Thanks for the heads up, I updated the example.

@dotinspace
Copy link

Getting the same error as original poster, trying to change handler.clj according to luminus-framework/luminus-template@f602989 results in a not found route:

FAIL in (test-app) (handler.clj:27)                                                                                                                     
not-found route                                                                                                                                         
expected: 404                                                                                                                                           
  actual: 500                                                                                                                                           
    diff: - 404                                                                                                                                         
          + 500

Noob here, so please excuse any mistakes. I see that I have to set up a route for 500, but still... the test should pass, no? I am following the Web Dev book, although newest template. Could that be the culprit?

@yogthos
Copy link
Member

yogthos commented Jul 15, 2019

It looks like a regression was introduced. Should be fixed in the latest template. Sorry for the trouble.

@aarkerio
Copy link

It looks like the regression is still there, the correct examples are here.

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

No branches or pull requests

5 participants