These are chat archives for dry-rb/chat

9th
Dec 2017
Hamza Khan-Cheema
@hamzakc
Dec 09 2017 09:04
Hi, Just a quick question. I am using dry-web-roda and making a API application. I am toying with a few ideas on how to test it. How do other people test API apps? I was playing with the idea of using bacon, but would like to use Rspec. Capybara is not really used to test API's so feature tests are out. The other option is just to use rack-test directly
Oskar Szrajer
@gotar
Dec 09 2017 09:09
I use rack-test always
workings great
Hamza Khan-Cheema
@hamzakc
Dec 09 2017 09:09
Thanks, I was leaning towards that as well.
you got any links on getting that working with dry-web by any chance
Hamza Khan-Cheema
@hamzakc
Dec 09 2017 09:14
isn't that using RSpec
Oskar Szrajer
@gotar
Dec 09 2017 09:15
i uses rack-tests too
for requests
I can extract you some tests from my projects
if you want
Hamza Khan-Cheema
@hamzakc
Dec 09 2017 09:16
don't want to trouble you :)
i will try and use berg as a template and get it working
thanks for the offer
you tried bacon ?
here you go, spec_helpers. and some tests
using berg as a template is quite hard at the beginning
if you need any more files, tests just ask
I used that combination (rack-test, rspec) for 4-5 different APIs in last few years always working great
Oskar Szrajer
@gotar
Dec 09 2017 09:27
https://github.com/gotar/sinatra-rom - some very old repo but shows how to connects rack-test with sinatra (in roda is almost exactly the same) - much easier one
Gustavo Caso
@GustavoCaso
Dec 09 2017 09:28
I think using the dry-web-roda cli will build some spec helpers with some sort of configuration already
Here is the one generated for one of my toy project
Oskar Szrajer
@gotar
Dec 09 2017 09:29
yeah but it's overkill for API
and do not use rack-test in pure direct way as I remember
Gustavo Caso
@GustavoCaso
Dec 09 2017 09:35
Sure
Totally true
Oskar Szrajer
@gotar
Dec 09 2017 09:35
one day will be great to have --only-api switch for generator :)
one day
Gustavo Caso
@GustavoCaso
Dec 09 2017 10:08
:+1:
Hamza Khan-Cheema
@hamzakc
Dec 09 2017 11:20
@gotar Thanks, really appreciate it :thumbsup: