I’m not sure what would be best practise to treat this case.
t.boolean :fetched, :null => false, :default => false
validates_inclusion_of :fetched, :in => [true, false]
article = Article.new(valid_attributes.except(:fetched))
Like this the spec will always fail because although fetched is excepted
the hash returned by valid_attributes, it still gets set to false due to
default value. Therefore no error and therefore the spec booms.
A solution would be to use this instead:
article = Article.new(valid_attributes.with(:fetched => nil))
But that would block refactoring if many attributes are tested for