[Rt-commit] rt branch, new-style-templates, updated. rt-3.8.8-206-g55e6f46

Shawn Moore sartak at bestpractical.com
Fri Jul 23 20:37:12 EDT 2010


The branch, new-style-templates has been updated
       via  55e6f4651488f1dcad9e2cd9cb17d154ecfee4b5 (commit)
      from  fa41e0756a5a10c9c3414f6fc36571d498db4e16 (commit)

Summary of changes:
 t/web/template.t |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit 55e6f4651488f1dcad9e2cd9cb17d154ecfee4b5
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Jul 23 20:38:51 2010 -0400

    Specifically make sure there's a permission denied error

diff --git a/t/web/template.t b/t/web/template.t
index 99d4f65..3efcef5 100644
--- a/t/web/template.t
+++ b/t/web/template.t
@@ -2,11 +2,21 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 11;
+use RT::Test tests => 17;
 
-my ($baseurl, $m) = RT::Test->started_ok;
+my $user_a = RT::Test->load_or_create_user(
+    Name => 'user_a', Password => 'password',
+);
+ok $user_a && $user_a->id, 'loaded or created user';
 
-ok $m->login, 'logged in';
+RT::Test->started_ok;
+
+ok( RT::Test->set_rights(
+    { Principal => $user_a, Right => [qw(ShowConfigTab ShowTemplate ModifyTemplate)] },
+), 'set rights');
+
+my $m = RT::Test::Web->new;
+ok $m->login('user_a', 'password'), 'logged in as user A';
 
 # get to the templates screen
 $m->follow_link( text => 'Configuration' );
@@ -37,5 +47,17 @@ $m->submit;
 
 $m->title_is(q{Modify template Resolved}, 'modifying the Resolved template');
 $m->form_name('ModifyTemplate');
-is($m->value('Type'), 'Full', 'updated type back to full');
+is($m->value('Type'), 'Simple', 'need the FullTemplates right to update Type to Full');
+$m->content_contains('Permission Denied');
+
+ok( RT::Test->add_rights(
+    { Principal => $user_a, Right => [qw(FullTemplates)] },
+), 'add FullTemplates rights');
+
+$m->field(Type => 'Full');
+$m->submit;
+
+$m->title_is(q{Modify template Resolved}, 'modifying the Resolved template');
+$m->form_name('ModifyTemplate');
+is($m->value('Type'), 'Full', 'now that we have FullTemplates we can update Type to Full');
 

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


More information about the Rt-commit mailing list