Rails functional tests - unexpected 406 responses

Fun discovery today of confusing behavior with Rails functional test framework (at least version 2.3.4): ### controller ### def create comment = Comment.create!(:name => params[:name]) @result = { :id => comment.id } respond_to do |format| format.xml { render } format.json { render :json => @result } end end ### functional test ### def »

How to Unit Test a custom Rails Form Builder

I recently created my first custom Rails builder.  It was very easy to do.First, create a class that inherits from ActionView::Helpers::FormBuilder and then you can either write your own methods or overwrite the built in text_field, check_box, radio_button, etc.class MyFirstFormBuilder < »

Detect if object is empty in JavaScript

I recently ran across a scenario where a function of mine was returning an Object (also known as a hash in other languages such as Ruby), and I wanted to check in the caller whether the returned Object was empty or not. I did not care what the contents were, »

Usability fail: similar dialogs, different actions

Since Flash 10, the upgrade experience is fairly streamlined, but the dialogs that appear have tripped me up on multiple occasions.  And yes, I stress multiple, because they have a point release every week it seems, and with my 3 virtual machines plus main machine I went through a »

Website fail: invalid data

It's no secret that I do not like Cox Communications.  I am not a fan of monopolies in any industry (don't get me started about text message "packages" and voice plans by cell phone companies), and I hate how Cox can get away with anything because they are »