I have been using the builtin RSpec mocking framework for a couple of years and haven’t had any issues with it. The one feature I have been missing though is the any_instance method of the Mocha framework. What this method lets you do is mock a method on all instances of a given class. This [...]
February 24, 2010 – 6:34 pm
In RSpec it is still not possible to have mocks or stubs on all instances of a class, although this has been suggested and it is a feature of the Mocha framework. Stubbing or mocking an object returned by an ActiveRecord belongs_to association (i.e. article.author) won’t do what you expect. Instead of mocking the associated [...]
January 26, 2010 – 3:41 pm
As documented already by Doug URI.parse will thrown an exception if your URL has a trailing space. It also throws an exception on invalid URLs in general. To avoid having URI.parse bomb on your pages you can use a construct like this:
January 13, 2010 – 6:44 pm
I’ve patched the acts_as_bitfield plugin to recognize “true” as true so that now instead of having to write:
<%= f.radio_button(:email_activated, true, :checked => (”checked” if @item.email_activated?)) %> Yes
<%= f.radio_button(:email_activated, false, :checked => (”checked” unless @item.email_activated?)) %> No
you can omit the checked argument just like with ActiveRecord boolean attributes:
<%= f.radio_button(:email_activated, true) %> Yes
<%= f.radio_button(:email_activated, false) %> No
March 25, 2009 – 10:46 am
In our last post we talked about upgrading to Rails 2.3, and the issues we encountered. One bug we found was that multiple POST requests issued in a test didn’t reset the post parameters between requests. The patch Peter submitted is now part of the Rails core, and we are very happy about it.
Perhaps not [...]
November 28, 2008 – 2:38 pm
Welcome to the blog! I thought it would be appropriate to shortly present Newsdesk in a post before anything else.
If you don’t know about us (and chances are small you do, unless you’re living in Sweden), we are a Swedish equivalent to PRWeb, or PR Newswire in some ways.
We are an online visibility company. Corporations [...]