~ubuntu-branches/ubuntu/oneiric/request-tracker3.8/oneiric-updates

« back to all changes in this revision

Viewing changes to t/customfields/sort_order.t

  • Committer: Bazaar Package Importer
  • Author(s): Dominic Hargreaves, Dominic Hargreaves, Christian Perrier
  • Date: 2009-06-16 21:46:59 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090616214659-5ji9k1n3qyc2br3n
Tags: 3.8.4-1
[ Dominic Hargreaves ]
* Add missing comma in Depends (fixes FTBFS on etch)
* Update debconf translations: pt.po, ja.po, sv.po, it.po, cs.po, ru.po
  (Closes: #519885, #519922, #520603, #520759, #521199, #521926)
* Document preference for not using SQLite in production
  (Closes: #512750)

[ Christian Perrier ]
* Debconf templates and debian/control reviewed by the debian-l10n-
  english team as part of the Smith review project.
  (Closes: #522367, #520959)
* [Debconf translation updates]
  - Japanese. Closes: #522896
  - German. Closes: #520958
  - Portuguese. Closes: #523481
  - Galician. Closes: #524256
  - Galician. Closes: #524256
  - Spanish. Closes: #524449
  - Italian. Closes: #524715
  - Russian. Closes: #524894
  - Swedish. Closes: #525171
  - French. Closes: #525281

[ Dominic Hargreaves ]
* Don't tell dbconfig to comment out unused variables, since this
  breaks MySQL and Postgres database configuration (Closes: #523090)
* Update Standards-Version (no changes)
* Switch dependency on sysklogd to rsyslog (Closes: #526914)
* New upstream release; includes
  - Minor security fix (Closes: #533069)
  - Add missing Postgres index (Closes: #512653)
* Patch webmux.pl to provide a better error message when the wrong
  major version of RT is in @INC (for example in a mod_perl context).
  (Closes: #518692)
* Add some more example Exim 4 configuration (Closes: #238345)
* Don't apply database ACLs in databases managed by dbconfig-common.
* Remove unused ACL patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
 
 
3
use strict;
 
4
use warnings;
 
5
 
 
6
use Test::More tests => 18;
 
7
use RT::Test;
 
8
use RT::Ticket;
 
9
use RT::CustomField;
 
10
 
 
11
my $queue_name = "CFSortQueue-$$";
 
12
my $queue = RT::Test->load_or_create_queue( Name => $queue_name );
 
13
ok($queue && $queue->id, "$queue_name - test queue creation");
 
14
 
 
15
diag "create multiple CFs: B, A and C" if $ENV{TEST_VERBOSE};
 
16
my @cfs = ();
 
17
{
 
18
    my $cf = RT::CustomField->new( $RT::SystemUser );
 
19
    my ($ret, $msg) = $cf->Create(
 
20
        Name  => "CF B",
 
21
        Queue => $queue->id,
 
22
        Type  => 'FreeformSingle',
 
23
    );
 
24
    ok($ret, "Custom Field Order created");
 
25
    push @cfs, $cf;
 
26
}
 
27
{
 
28
    my $cf = RT::CustomField->new( $RT::SystemUser );
 
29
    my ($ret, $msg) = $cf->Create(
 
30
        Name  => "CF A",
 
31
        Queue => $queue->id,
 
32
        Type  => 'FreeformSingle',
 
33
    );
 
34
    ok($ret, "Custom Field Order created");
 
35
    push @cfs, $cf;
 
36
}
 
37
{
 
38
    my $cf = RT::CustomField->new( $RT::SystemUser );
 
39
    my ($ret, $msg) = $cf->Create(
 
40
        Name  => "CF C",
 
41
        Queue => $queue->id,
 
42
        Type  => 'FreeformSingle',
 
43
    );
 
44
    ok($ret, "Custom Field Order created");
 
45
    push @cfs, $cf;
 
46
}
 
47
 
 
48
my ($baseurl, $m) = RT::Test->started_ok;
 
49
ok $m->login( root => 'password' ), 'logged in';
 
50
 
 
51
diag "reorder CFs: C, A and B" if $ENV{TEST_VERBOSE};
 
52
{
 
53
    $m->get( '/Admin/Queues/' );
 
54
    $m->follow_link_ok( {text => $queue->id} );
 
55
    $m->follow_link_ok( {text => 'Ticket Custom Fields'} );
 
56
 
 
57
    my @tmp = ($m->content =~ /(CF [ABC])/g);
 
58
    is_deeply(\@tmp, ['CF B', 'CF A', 'CF C']);
 
59
 
 
60
    $m->follow_link_ok( {text => 'Move up', n => 2} );
 
61
    $m->follow_link_ok( {text => 'Move up', n => 1} );
 
62
    $m->follow_link_ok( {text => 'Move up', n => 2} );
 
63
 
 
64
    @tmp = ($m->content =~ /(CF [ABC])/g);
 
65
    is_deeply(\@tmp, ['CF C', 'CF A', 'CF B']);
 
66
}
 
67
 
 
68
diag "check ticket create, display and edit pages" if $ENV{TEST_VERBOSE};
 
69
{
 
70
    $m->submit_form(
 
71
        form_name => "CreateTicketInQueue",
 
72
        fields => { Queue => $queue->Name },
 
73
    );
 
74
 
 
75
    my @tmp = ($m->content =~ /(CF [ABC])/g);
 
76
    is_deeply(\@tmp, ['CF C', 'CF A', 'CF B']);
 
77
 
 
78
    $m->submit_form(
 
79
        form_name => "TicketCreate",
 
80
        fields => { Subject => 'test' },
 
81
    );
 
82
    my ($tid) = ($m->content =~ /Ticket (\d+) created/i);
 
83
    ok $tid, "created a ticket succesfully";
 
84
    
 
85
    @tmp = ($m->content =~ /(CF [ABC])/g);
 
86
    is_deeply(\@tmp, ['CF C', 'CF A', 'CF B']);
 
87
 
 
88
    $m->follow_link_ok( {text => 'Custom Fields'} );
 
89
 
 
90
    @tmp = ($m->content =~ /(CF [ABC])/g);
 
91
    is_deeply(\@tmp, ['CF C', 'CF A', 'CF B']);
 
92
}
 
93