Browse files

Add functional test for Array default

  • Loading branch information...
1 parent 63a2aad commit 76bc62885a9da48db31b234eb6423d367fd411c9 @cgriego committed May 21, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 spec/functional/active_attr/attribute_defaults_spec.rb
View
8 spec/functional/active_attr/attribute_defaults_spec.rb
@@ -58,6 +58,14 @@ module ActiveAttr
end
end
+ context "an attribute with a default empty Array" do
+ before { model_class.attribute :roles, :default => [] }
+
+ it "the attribute getter returns an empty array by default" do
+ subject.roles.should == []
+ end
+ end
+
context "an attribute with a dynamic Time.now default" do
before { model_class.attribute :created_at, :default => lambda { Time.now } }

0 comments on commit 76bc628

Please sign in to comment.