Erik Terpstra
2008-May-21 20:32 UTC
[rspec-users] RSpec for testing REST webservices? (Not Rails)
Hi, I am new to RSpec and BDD. I was wondering if RSpec specifications are a good solution for testing REST webservices (not implemented in Rails). If so, what would be a good way to test something like the API described below? ========== GET http://localhost/workflow text/xml Result: 200 OK <?xml version="1.0"?> <workflows> <workflow>flow1</workflow> <workflow>flow2</workflow> <workflow>flow3</workflow> </workflows> POST http://localhost/workflow?name=flow4 text/xml Data: <?xml version="1.0"?> <workflow> <monitor type="page" priority="0"> <provides result="test"/> </monitor> <process command="test" id="test" weight="100"> <needs result="test"/> <provides result="test_result"/> <error result="error"/> </process> </workflow> Result: 201 Created GET http://localhost/workflow text/xml Result: 200 OK <?xml version="1.0"?> <workflows> <workflow>flow1</workflow> <workflow>flow2</workflow> <workflow>flow3</workflow> <workflow>flow4</workflow> </workflows> GET http://localhost/workflow/flow4 text/xml Result: 200 OK <?xml version="1.0"?> <workflow> <monitor type="page" priority="0"> <provides result="test"/> </monitor> <process command="test" id="test" weight="100"> <needs result="test"/> <provides result="test_result"/> <error result="error"/> </process> </workflow> DELETE http://localhost/workflow/flow3 Result: 204 No Content GET http://localhost/workflow text/xml Result: 200 OK <?xml version="1.0"?> <workflows> <workflow>flow1</workflow> <workflow>flow2</workflow> <workflow>flow4</workflow> </workflows> ==== TIA, Erik.
Pol Llovet
2008-Jun-06 16:20 UTC
[rspec-users] RSpec for testing REST webservices? (Not Rails)
I am interested in this also, anyone out there have some best practices? -- Posted via http://www.ruby-forum.com/.
Yi Wen
2008-Jun-06 17:16 UTC
[rspec-users] RSpec for testing REST webservices? (Not Rails)
I use http-access2 (http://dev.ctor.org/http-access2) for make requests. I also have a custom WebServiceExampleGroup to do setup work there. On Fri, Jun 6, 2008 at 11:20 AM, Pol Llovet <lists at ruby-forum.com> wrote:> I am interested in this also, anyone out there have some best practices? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Reasonably Related Threads
- Testing REST webservices? (Not Rails)
- [StructurizeCFG] Trouble with branches out of a loop
- Samba shows error NT Status: STATUS_OBJECT_NAME_NOT_FOUND when copying 10GB file using robocopy when ecryptfs file system shared using samba
- Samba shows error NT Status: STATUS_OBJECT_NAME_NOT_FOUND when copying 10GB file using robocopy when ecryptfs file system shared using samba
- predict(lm(etc.), some_data) -> "numeric envir arg not of length one " ???