faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
_whitelogger has joined #amber
_whitelogger has joined #amber
Hamoondancer has joined #amber
Hamoondancer has left #amber [#amber]
_whitelogger has joined #amber
Ifera has joined #amber
Ifera has left #amber [#amber]
rinzi has joined #amber
rinzi has left #amber [#amber]
<FromGitter> <elorest> <robocarp> could you help me figure out how to get travis passing again since the new version of crystal was released. Still passes just fine locally but crecto tests fail on travis.
<FromGitter> <faustinoaq> Hi community, sorry for being offline latest year, new crystal-vscode minor version is published https://github.com/crystal-lang-tools/vscode-crystal-lang/releases/tag/v0.3.11 πŸ˜„ ⏎ ⏎ Hopefully new Scry (https://github.com/crystal-lang-tools/scry/) backend is activated by default on new major release πŸ‘
<FromGitter> <grantspeelman> Hey All, new to amber and crystal.
<FromGitter> <grantspeelman> Was hoping someone could point me in the direction of how I would write a controller test
<FromGitter> <grantspeelman> the generator does not seem to insert any assertions :(
feepbot has quit [Ping timeout: 244 seconds]
feepbot has joined #amber
<FromGitter> <grantspeelman> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5c5c2192c2dba5382ef6bbef]
<FromGitter> <grantspeelman> can anyone help me please?
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <Blacksmoke16> https://github.com/amberframework/amber/blob/master/spec/amber/controller/respond_with_spec.cr can maybe take a look at how amber sets it up?
<FromGitter> <Blacksmoke16> looks like they're just newing up and going thru the controller itself
<FromGitter> <charleystran> My understanding is that amber doesnt have a `send` method like ruby, but is there a way to dynamically access attributes of a model? here is a simplified example of what I am looking for. My real example has over 100 properties which is why I want to make it dynamic
<FromGitter> <charleystran> User = User.find 1 ⏎ attributes = [β€œname”, β€œemail”, β€œcity”, β€œstate”] ⏎ attributes.each do |attribute| ⏎ user.send(attribute) ⏎ end [https://gitter.im/amberframework/amber?at=5c5c66aa9221b9382d2f07c9]
<FromGitter> <faustinoaq> > My understanding is that crystal doesnt have a send method like ruby, ⏎ ⏎ Yeah, `send` doesn't exist on crystal (please avoid dark magic like this (https://gist.github.com/veelenga/91fb751286b35f1b497f1a1c41228c06) ) πŸ˜…
<FromGitter> <Blacksmoke16> @charleystran what do you want to access? just their name or values?
<FromGitter> <faustinoaq> @grantspeelman Amber already does something similar here https://github.com/amberframework/garnet-spec/blob/cbf8bad49ea04981060287e20b501688c5cd851d/src/garnet_spec/request_helper.cr#L22, although I guess there is some way to test Controllers without a route πŸ˜…
<FromGitter> <Blacksmoke16> there is a diff between testing a controller's methods on their own, versus the full flow of request to resposne
<FromGitter> <Blacksmoke16> ideally would have both
<FromGitter> <charleystran> @faustinoaq its not dark magic, just be smart at how you use it
<FromGitter> <charleystran> @Blacksmoke16 I just need the values, no setters, just the values
<FromGitter> <Blacksmoke16> you could do something like
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/673q
<FromGitter> <Blacksmoke16> @charleystran
<FromGitter> <charleystran> thanks, I will check it out
<FromGitter> <Blacksmoke16> or if you are using `property` can rewrite it to `{{@type.instance_vars.map(&.id)}}`
<FromGitter> <Blacksmoke16> and that would call the getter for each property to get the value