roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
roshanavand has quit [Ping timeout: 244 seconds]
gr33n7007h has quit [Ping timeout: 252 seconds]
gr33n7007h has joined #ruby
Pancakes11 has joined #ruby
Pancakes11 has quit [Client Quit]
MalkbabY has quit [Quit: Leaving...]
hsiktas[m] has quit [*.net *.split]
nolesswrong has quit [*.net *.split]
nowaker_ has quit [*.net *.split]
wmoxam_ has quit [*.net *.split]
georgemp has quit [*.net *.split]
leftylink has quit [*.net *.split]
wmoxam has joined #ruby
nolesswrong has joined #ruby
Nowaker has joined #ruby
leftylink has joined #ruby
georgemp has joined #ruby
hsiktas[m] has joined #ruby
jpw_ has quit [Remote host closed the connection]
ur5us has joined #ruby
vit has joined #ruby
ur5us has quit [Ping timeout: 264 seconds]
edrx has left #ruby [Killed buffer]
dostoyevsky2 has quit [Quit: leaving]
dostoyevsky2 has joined #ruby
dostoyevsky2 has quit [Client Quit]
dostoyevsky2 has joined #ruby
goepsilongo has quit [Ping timeout: 245 seconds]
goepsilongo has joined #ruby
Bounga has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.3]
mahlon has quit [Quit: PotatoTech]
mahlon has joined #ruby
yosafbridge` has quit [Quit: Leaving]
yosafbridge has joined #ruby
Intelo has joined #ruby
<Intelo>
While doing integration test for api testing. What is a good way to test? a) make api call inside test code and also directly check (fetch/select) entries in database those were supposed to be created by that api cal. b) in response of real api call, always return json of objects created in database (e.g user created, even if its a GET call and 200
<Intelo>
response might have been ok, just to test what was created, I should return what was inserted / updated in database for each api call c) try to check one api with another api (this might not always be possible). e.g test create user api with user profile api. If user was created successfully, then profile api should return correct data. c) any
<Intelo>
other?
yxhuvud has quit [Remote host closed the connection]
yxhuvud has joined #ruby
<nakilon>
Intelo I go for C
<nakilon>
in my opinion you should do only unit-testing and functional/integration testing, not anything in between
<nakilon>
so you use as high level methods as possible, i.e. just use api calls and don't access db at all
<nakilon>
on my prevprevious job I had to spend half of the time fixing legacy tests that were not made in that in mind, spent time stupidly on throwing out sql requests, wrongly places procedures of connecting to db, etc.
fandre1986 has joined #ruby
<Intelo>
nakilon ok so lets say I am testing a user registration api. It has name, email, address. How will I verify that the user actually got registered and the data was saved in the database?
goepsilongo_ has joined #ruby
goepsilongo has quit [Ping timeout: 252 seconds]
quazimodo has quit [Ping timeout: 258 seconds]
donofrio has quit [Read error: Connection reset by peer]
roadie has joined #ruby
goepsilongo_ has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<sagax>
it's for dot-notation from yaml config file
<adam12>
sagax: It looks OK generally, as long as you're not calling preload in a hotpath. Defining methods dynamically clears some caches in the Ruby VM, and in a hotpath it's absolute performance murder.
<adam12>
sagax: Instead of defining on `self` (as cls), you could always define them inside a module and include that module too. It might help keep them organized.
jpw has quit [Ping timeout: 260 seconds]
roshanavand has quit [Ping timeout: 260 seconds]
kaleido has quit [Ping timeout: 260 seconds]
fandre1986 has quit [Quit: Connection closed]
<sagax>
thanks
<Intelo>
nakilon login will not tell the address
Starfoxxes has quit [Ping timeout: 245 seconds]
Bounga has quit [Remote host closed the connection]
steerpike has joined #ruby
<steerpike>
hi, can i ask questions about rspec in here?
<adam12>
dviola: If you have an object `r` inside your routing tree, you could probably do `r.get_header("Authorization")`
<dviola>
adam12: interesting, let me try that
<adam12>
dviola: `r` is just the current request, so anywhere in your routing tree that's in the context of Roda, you could do `request.get_header("Authorization")` as well. But `r` is the common shorthand.
<dviola>
makes sense
<dviola>
I get nil
<dviola>
I get it now with r.get_header("HTTP_AUTHORIZATION") after adding plugin :request_headers
<adam12>
dviola: Ah. Yes, Rack sometimes mutates header names.
<adam12>
dviola: If you use request_headers plugin, the syntax is nicer, since you can use `r.headers`.
<dviola>
env['HTTP_AUTHORIZATION'] also works
<dviola>
nice
<dviola>
adam12: thanks a lot :)
<adam12>
dviola: cheers.
<adam12>
I sometimes look at `env` to see what the header name is
bhaak has joined #ruby
Rounin has joined #ruby
___nick___ has joined #ruby
orbyt has joined #ruby
donofrio has joined #ruby
seabre has joined #ruby
<nakilon>
infernix log in and call some "look into my profile" http api endponit that should show the address
<cuppajoeman>
Hello there, I'm trying to install jekyll I'm using manjaro, so far I've run `sudo pacman -S ruby base-devel` then `gem install jekyll bundler` added ruby to my path , and then ran `bundle exec jekyll serve` I've also run `bundle add webrick` to no avail, the error I get is this: `/usr/lib/ruby/3.0.0/pathname.rb:49:in `basename': no implicit conversion of nil into String (TypeError)` THe full error I get is this:
postmodern has quit [Remote host closed the connection]
<cuppajoeman>
When running with `--trace` the error becomes: bundler: failed to load command: jekyll (/home/ccn/.local/share/gem/ruby/3.0.0/bin/jekyll)