json - How do you assert a String in Capybara? -


i testing api call server using cucumber + capybara selenium webdriver. managed response obj, how assert response body contains string? example if response body contains "hello world" want assert response body (which string) contains pattern "world"

ex. like:

response = http.request(request)
response.body.should have_text("world")

alternatively there way "application/json" response , assert contents using capybara?

thanks!

i think looking have_content.

response.body.should have_content("world") 

for more info, check out readme: check out documentation: https://github.com/jnicklas/capybara


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -