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 ?
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.