You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a --server-config option for the console command to load the full Roda stack, but we don't actually have an obvious way of testing routes in the console. I spent some time playing around with getting Rack Test loaded, and it turns out to be surprisingly easy!
gem"rack-test"# add this to your Gemfile# then when you run `bin/bridgetown console --server-config`:require"rack/test"IRB::ExtendCommandBundle.includeRack::Test::Methodsdefapp=RodaApp.appget'/'doc=Nokolexbor::Document.parseget("/").bodydoc.query_selector("h2").inner_html# inspect your responseget("/preview/docs/_docs%2Findex.md").body# => test a dynamic server route
I think what we should do is add conditional code in the console command for the server boot where, if the "rack-test" gem is available, we set up these commands. If not, no worries! Then we can add documentation for folks to add "rack-test", and also it can be part of our overall Minitest bundled configuration aka #570.
The text was updated successfully, but these errors were encountered:
We have a
--server-config
option for theconsole
command to load the full Roda stack, but we don't actually have an obvious way of testing routes in the console. I spent some time playing around with getting Rack Test loaded, and it turns out to be surprisingly easy!I think what we should do is add conditional code in the console command for the server boot where, if the "rack-test" gem is available, we set up these commands. If not, no worries! Then we can add documentation for folks to add "rack-test", and also it can be part of our overall Minitest bundled configuration aka #570.
The text was updated successfully, but these errors were encountered: