I have the following code in my controller:
format.json { render :json => { :flashcard => @flashcard, :lesson => @lesson,
Simple and easy to way to do this.
# set some variable on success like :success => true in your controller controller.rb render :json => {:success => true, :data => data} # on success spec_controller.rb parse_json = JSON(response.body) parse_json["success"].should == true