addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupsimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1outlookpersonJoin Group on CardStartprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Automatic Testing of REST Web Services Client with Rails by Owen Ou

  • Aug 25, 2011 · 7:00 PM
  • Orbs.com

Testing REST web services client has never been easy. It requires a running web server, multiple threads, network conection and complex transaction management.

Ideally, REST web service client test should have the following characteristics:

  1. The experience of testing REST resource is similar to that of testing an ActiveRecord model
  2. Start up and shut down web server for the purpose of running REST web services
  3. Rollback test data after each test
  4. Control fixture creation for REST web services
  5. All tests are automatic

In this talk, I am going to write and test a REST web service API together with you using TDD.  As we go we will discuss some tricks of testing web service client code. Highlights include using ActiveResource for web service resource test, transactional rollback with dRuby, and fixture creation with dRuby etc. Come hang out and hack some code together! 

You can find more info about talk here:  http://owenou.com/2011/07/20/testing-rest-web-services-with-rails.html.

Join or login to comment.

  • A former member
    A former member

    Good presentation; I learned a couple of new things, which is always good.

    August 26, 2011

  • Eugene G.

    Thanks for the presentation. Looking forward to your gem progress - I certainly have ideas for it regarding what Sage is doing :-)

    August 26, 2011

  • Sunny H.

    Thanks Owen, I enjoyed the presentation. I also like the creative approach of using DRb to synchronize the test client with the server. I really enjoy this kind of out of the box thinking to pragmatically solve problems.

    August 26, 2011

  • Luke C.

    Really interesting material. A bold move writing the code live, but Owen pulled it off.

    August 26, 2011

  • A former member
    A former member

    Great talk. I really liked the approach of team coding. The issue of concurrent requests and transactions seemed to stir the audience. It would have been nice if the host could have been able to quiet them down. It was good that he simply carried on.

    August 26, 2011

  • Aaron

    This was a good topic with a nice approach by Owen.
    I liked the "let's program together" approach, although it did seem to drag at times. Still, there were interesting things coming up while programming that everyone would encounter in real life.

    Overall, well done, and applicable to more than just Ruby or Rails!

    August 26, 2011

  • Owen O.

    I have done some research on one of the questions of running multiple REST service client tests concurrently, looks like there is a mutex lock on ActiveRecord's connection when a SQL query is running, although only connection is shared, the 2nd one that comes in will be blocked, https://github.com/rails/rails/blob/master/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb#L258

    August 25, 2011

  • A former member
    A former member

    Great talk, thanks Owen. You gave us many good trick for testing REST services, will definitely try them out.

    August 25, 2011

  • Aaron

    Thanks for the presentation Owen! I'm sure it'll come in useful when doing TDD for our REST-based API.

    August 25, 2011

  • Owen O.

    Thanks all for coming, the slides are available here: http://owenou.com/testing_web_services_client_slides.

    August 25, 2011

  • Aaron

    Thanks Sunny!

    August 25, 2011

  • Sunny H.

    Normally I'd say yes and if one more showed up it would be okay. The problem is that I usually invite 40 and several don't show up and we have a few extra seats. This time I invited 50 so I've already taken into account that some people won't show up. So if everybody shows up, we will fit but there will be some standing room only areas.

    August 25, 2011

  • Gavin D.

    I'm sure of the 50 signed up that some won't turn up anyway, and nobody will have to look bad :)

    August 25, 2011

  • Aaron

    Possibly, but not necessarily. If you're on the waiting list, then there's a built-in expectation of rejection at the door - at least from my perspective.

    August 25, 2011

  • Gavin D.

    That would be rather disrespectful, wouldn't it?

    August 25, 2011

  • Aaron

    Can we still show up if we're on the waiting list? Ie., are you turning people away?

    August 24, 2011

50 went

Our Sponsors

  • Brewhouse

    Vancouver's leading product development studio

  • CodeCore

    Build Rails Apps in 9 Weeks! Full-Time and Part-Time Development Program

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy