I have two applications, a Rails JSON API, and a Javascript client framework.

What is the best way to do integration tests ?

And another question, can this be done via Capybara ?

有帮助吗?

解决方案

If you want a true integration test, you can use Capybara with a driver that executes javascript, like Poltergeist, or Capybara-Webkit. Alternatively, you could use Selenium, but that's not quite as slick as a headless test.

That said, you will probably have a lot more luck and more solid tests if you test your front end and back end separately with Rspec on the back and Jasmine/Qunit on the front. Integration tests with JS are often tricky.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top