Full RESTful Web Service Testing (Rails)

I try to sift through a lot of test solutions there, and I'm not even sure that I will go in the right direction. The story is this: we are launching the RESTful web service, implemented as a Rails application that supports our mobile clients. We are testing a web service (of course), but this involves mocking many parts of the application, such as the search stack (Apache SOLR).

In addition, our tests do not (i.e. cannot!) Cover critical routes, such as the mobile login / logon process, as this is related to the exchange of information between the API application and the mobile site, where the user can enter credentials, for example, for SSO (Janrain Engage). Therefore, the standard Rails integration test will fail.

I understand that theoretically, if the test suite is very well designed, where the mockery occurs only at the connection points where the tests for the next level start, and then through unit or functional testing of the service’s service API and mobile website separately, you can get same coverage. I find this in practice, although it is an illusion if you have several developers working on a set of tests on their own; I just admit that our unit tests are simply not that well designed. In particular, when implementing TDD, I found that although tests can control the application code, the design of the test code is intended only for the device under test, which leads to a rather wildly expressed set of tests.

Another thing that I discovered is that sometimes we did not determine regressions using only single tests, where, for example, bad requests were sent to the SOLR server due to the detonation effect. This is why I thought that the only real way to ensure that the entire stack works on critical routes is through automatic testing on an intermediate server before each deployment, that is, with actual HTTP requests sent to the application.

My questions:

  • Do you think this is a reasonable thing at all? I found very little information about end-to-end testing of the live API on the Internet, leaving me at a loss as to whether I really understand.
  • / ? Watir -, , , - ( , JS - UI-ish). - , Ruby script ?
  • , w.r.t. ?
+5
1

: http://groups.google.com/group/ruby-capybara/browse_thread/thread/5c27bf866eb7fad3

, ( ) , , -

Given I have 2 posts
When I send "DELETE" to post with id 1
Then I should have 1 post

, API .

+1

All Articles