Closed zeknox closed 4 years ago
I can confirm this issue exists when models_test.go
, where ModelSuite
is defined, belongs to the models
package instead of the models_test
package. This seems to be the default behavior for apps created with buffalo new
. This is fixed by changing package models
in models_test.go
to package models_test
.
This one was covered in v1.0.8. please give it a shot and keep us posted.
@paganotoni That fixed it. Thanks!
Hi! I’ve installed the
buffalo-auth
plugin using the commandgo getgithub.com/gobuffalo/buffalo-auth
. This completes properly and the buffalo-auth command runs properly from my$PATH
.I've run the
buffalo-auth auth
command against my project and this has generated proper auth structure; however, when running the default tests which are generated its throwing multiple errors:Looking at the default code which is generated, the test functions are passing in the argument
(ms *ModelSuite)
but this is not defined in a location that the test is aware of.I've been able to resolve this issue by modifying the default code to include the
ModelSuite
struct. Original Code generated by buffalo-auth:Fixed code which addresses the undefined condition and allows tests to run properly and pass. The primary additions are defining the struct and adding the additional import line.
I'm curious if there is something I've done wrong in the way I've installed the plugin or generated the auth code. Is this something the buffalo-auth auth generator should add to the
user_test.go
file by default? Any insight on the proper work flow or testing process would be greatly appreciated.