[Bps-public-commit] jifty-plugin-recordhistory branch, master, updated. d6779023cbdbc54fa043e84d1f2408f225559e33

Shawn Moore sartak at bestpractical.com
Wed Feb 9 00:36:37 EST 2011


The branch, master has been updated
       via  d6779023cbdbc54fa043e84d1f2408f225559e33 (commit)
       via  6b8eb006c5a7e5e24be8c5faa089be80d25a2e17 (commit)
      from  1a1ef9618e3ca2deef4409f4dd18b13457486d76 (commit)

Summary of changes:
 lib/Jifty/Plugin/RecordHistory/Model/Change.pm |    2 +-
 t/TestApp-Plugin-RecordHistory/t/001-basic.t   |   10 +++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 6b8eb006c5a7e5e24be8c5faa089be80d25a2e17
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Feb 9 00:36:19 2011 -0500

    A Change having changes is kinda confusing

diff --git a/lib/Jifty/Plugin/RecordHistory/Model/Change.pm b/lib/Jifty/Plugin/RecordHistory/Model/Change.pm
index 7177b58..f0f7634 100644
--- a/lib/Jifty/Plugin/RecordHistory/Model/Change.pm
+++ b/lib/Jifty/Plugin/RecordHistory/Model/Change.pm
@@ -31,7 +31,7 @@ use Jifty::Record schema {
         label is 'Type',
         is immutable;
 
-    column changes =>
+    column change_fields =>
         refers_to Jifty::Plugin::RecordHistory::Model::ChangeFieldCollection by 'change';
 };
 

commit d6779023cbdbc54fa043e84d1f2408f225559e33
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Feb 9 00:36:34 2011 -0500

    More tests

diff --git a/t/TestApp-Plugin-RecordHistory/t/001-basic.t b/t/TestApp-Plugin-RecordHistory/t/001-basic.t
index 4a723a1..3be7a85 100644
--- a/t/TestApp-Plugin-RecordHistory/t/001-basic.t
+++ b/t/TestApp-Plugin-RecordHistory/t/001-basic.t
@@ -2,7 +2,7 @@
 use warnings;
 use strict;
 
-use Jifty::Test::Dist tests => 2;
+use Jifty::Test::Dist tests => 8;
 
 my $book = TestApp::Plugin::RecordHistory::Model::Book->new;
 $book->create(
@@ -11,4 +11,12 @@ $book->create(
 ok($book->id, 'created a book');
 
 isa_ok($book->changes, 'Jifty::Plugin::RecordHistory::Model::ChangeCollection');
+is($book->changes->count, 1, 'one change');
+my $change = $book->changes->first;
+is($change->record_id, $book->id, 'record id');
+is($change->record_class, 'TestApp::Plugin::RecordHistory::Model::Book', 'record class');
+is($change->type, 'create', 'change has type create');
+
+isa_ok($change->change_fields, 'Jifty::Plugin::RecordHistory::Model::ChangeFIeldCollection', 'change field collection');
+is($change->change_fields->count, 0, 'generate no ChangeFields for create');
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list