Wednesday, November 12

Integration Testing: xml_http_request

I was referring to Agile Web Development with Rails book to implement the Integration testing. And as per the book it

xml_http_request "/store/add_to_cart" , :id => ruby_book.id

and strangely I was getting syntax error. Seems the book did miss out another parameter which would define the method type. Referring to online documentation, made things clear.

xml_http_request(request_method, path, parameters = nil, headers = nil)

Performs an XMLHttpRequest request with the given parameters, mirroring a request from the Prototype library.

The request_method is :get, :post, :put, :delete or :head; the parameters are nil, a hash, or a url-encoded or multipart string; the headers are a hash. Keys are automatically upcased and prefixed with ‘HTTP_’ if not already.

Saturday, November 8

Ajax even @ home - I am serious

It's been over two years I heard about this buzz word "AJAX". In fact I came to know about this through one of resumes that I interviewed for php programmers. And once I picked up Ruby on Rails framework, it became pretty common in daily work. Well to cut short and justify title of this post "Ajax even @ home - I am serious". Can't believe? See down ...



Have a nice weekend :)