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
Post a Comment