2

We have two separate Ruby on Rails apps, one that accepts uploaded files, the other that produces files from the uploads the other app received.

We're trying to put together end-to-end blackbox regression and integration tests that demonstrate that when you upload a certain file to the first app, you can count on getting a certain file out of the other app.

The question is how to script this, so that the two separate databases are reset with seeded values, the two servers are fired up and Capybara visits the two separate "web sites."

So far in building and testing each app we have relied on the Rails magic that makes things "just work," so dealing with separate databases, separate server ports and other unknown wrinkles is looking like a stumbling block.

Has anyone written up best practices for this kind of testing? Any examples of how to automate this kind of integration testing?

Daniel Ashton
  • 1,388
  • 11
  • 23

1 Answers1

1

You can put the both apps online with Heroku. Then use sauce_ruby gem from saucelabs.com as a connector to get rspec and capybara to run tests agains apps. Run heroku run rake db:reset to reseed (with seed.rb) the data before the tests(you can script this). sauce ruby

andreofthecape
  • 1,166
  • 11
  • 24
  • I like your answer very much. However, it feels heavier than I had hoped because it requires a deployment before you can run the tests and a database reset, and because Selenium is a bit heavier than the Capybara webkit driver or (even better) the racktest driver. I have a 90% solution that I hope to explain later: the part that is missing is the rspec transaction control in one of the databases. – Daniel Ashton May 29 '13 at 01:20
  • the sauce_ruby gem is deprecated, i'm currently looking for a 2016 solution, will post an answer when I found it :) – Ruff9 Aug 09 '16 at 16:32