<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,6 @@
+2009-05-20 - Sean Huber (shuber@huberry.com)
+  * Update ActiveRecord tests
+
 2009-01-18 - Sean Huber (shuber@huberry.com)
   * Don't attempt to encrypt/decrypt empty strings
 </diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -28,6 +28,11 @@ class Person &lt; ActiveRecord::Base
   end
 end
 
+class PersonWithValidation &lt; Person
+  validates_presence_of :email
+  validates_uniqueness_of :encrypted_email
+end
+
 class ActiveRecordTest &lt; Test::Unit::TestCase
   
   def setup
@@ -75,4 +80,18 @@ class ActiveRecordTest &lt; Test::Unit::TestCase
     assert Person.attr_encrypted_options[:encode]
   end
   
+  def test_should_validate_presence_of_email
+    @person = PersonWithValidation.new
+    assert !@person.valid?
+    assert @person.errors.on(:email)
+  end
+  
+  def test_should_validate_uniqueness_of_email
+    @person = PersonWithValidation.new :email =&gt; 'test@example.com'
+    assert @person.save
+    @person2 = PersonWithValidation.new :email =&gt; @person.email
+    assert !@person2.valid?
+    assert @person2.errors.on(:encrypted_email)
+  end
+  
 end
\ No newline at end of file</diff>
      <filename>test/active_record_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b0a701f208b5f34dde475841e7b9d687fa1113ec</id>
    </parent>
  </parents>
  <author>
    <name>Sean Huber</name>
    <email>shuber@huberry.com</email>
  </author>
  <url>http://github.com/shuber/attr_encrypted/commit/bad06491d17b1fd7dfd8ed5ac8bd1bb191381a05</url>
  <id>bad06491d17b1fd7dfd8ed5ac8bd1bb191381a05</id>
  <committed-date>2009-05-20T09:52:20-07:00</committed-date>
  <authored-date>2009-05-20T09:52:20-07:00</authored-date>
  <message>Update ActiveRecord tests</message>
  <tree>3910aa6ebf9af98af7b76f5dad3ed2798eb664a0</tree>
  <committer>
    <name>Sean Huber</name>
    <email>shuber@huberry.com</email>
  </committer>
</commit>
