[Bps-public-commit] jifty-plugin-recordhistory branch, master, updated. 0.05-6-ga28f456

Shawn Moore sartak at bestpractical.com
Thu Feb 24 18:45:10 EST 2011


The branch, master has been updated
       via  a28f456ea45a84ae25c271d339d81345be06d063 (commit)
      from  16428e82d07f473e5980892b54c26c4d9bc77272 (commit)

Summary of changes:
 .../t/008-access-control.t                         |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit a28f456ea45a84ae25c271d339d81345be06d063
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Feb 24 18:45:03 2011 -0500

    Ensure we can't forge changes

diff --git a/t/TestApp-Plugin-RecordHistory/t/008-access-control.t b/t/TestApp-Plugin-RecordHistory/t/008-access-control.t
index 5c58b55..071b0b7 100644
--- a/t/TestApp-Plugin-RecordHistory/t/008-access-control.t
+++ b/t/TestApp-Plugin-RecordHistory/t/008-access-control.t
@@ -2,7 +2,7 @@
 use warnings;
 use strict;
 
-use Jifty::Test::Dist tests => 40;
+use Jifty::Test::Dist tests => 41;
 
 my $user = TestApp::Plugin::RecordHistory::Model::User->new;
 $user->create(
@@ -78,3 +78,11 @@ $ticket->set_updatable(1);
 is($ticket->updatable, 0, "ticket was not updated");
 is($ticket->changes->count, 3, "still only three changes since we couldn't update the record");
 
+$change = Jifty::Plugin::RecordHistory::Model::Change->new(current_user => $current_user);
+$change->create(
+    record_class => ref($ticket),
+    record_id    => $ticket->id,
+    type         => 'forged',
+);
+ok(!$change->id, "couldn't create a change as an ordinary user");
+

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



More information about the Bps-public-commit mailing list