Testing RESTful Service in Ruby, Part 2: Run frequently in a Continuous Testing Server

Stabilizing the tests and setting them up in a Continuous Testing server

Zhimin Zhan

--

In Part 1, I created five RESTful service tests in Ruby. They were working, however, but the task is not completed yet.

Table of Contents:
· Stabilize Tests:
1. LIST all records
2. READ one record
3. CREATE a new record
4. UPDATE a new record
5. DELETE a record
· Run all tests in TestWise a couple of times
· Set up build project in BuildWise to run all tests in a CT Server
· Review (by Zhimin)
Effort on Test Creation is minor
The Power of Scripting in Ruby
Universally Applicable
Freedom and Fun
The Synergy

I hardcoded an ID value (e.g. 66670) to use in some tests, which run fine once only. The ID might already be taken (duplicate error for CREATE), or may not exist (causing READ, UPDATE and DELETE operations to fail). Also, I didn’t clean up after using it.

To run tests in a Continuous Testing (CT) server, I should stabilize the tests firsts: can run them successfully multiple times. In this article, I will revise the tests written in Part 1 and set up running them in a CT server, as regression testing.

Stabilize Tests:

--

--