File: cf_render_type.t

package info (click to toggle)
request-tracker5 5.0.7%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 80,216 kB
  • sloc: javascript: 191,898; perl: 87,146; sh: 1,412; makefile: 487; python: 37; php: 15
file content (50 lines) | stat: -rw-r--r-- 1,285 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
use strict;
use warnings;

use RT::Test tests => 8;

my ($baseurl, $m) = RT::Test->started_ok;
ok $m->login, 'logged in as root';

my $cf_name = 'test render type';

my $cfid;
diag "Create a CF";
{
    $m->follow_link( id => 'admin-custom-fields-create');
    $m->submit_form(
        form_name => "ModifyCustomField",
        fields => {
            Name          => $cf_name,
            TypeComposite => 'Freeform-1',
            LookupType    => 'RT::Queue-RT::Ticket',
        },
    );
    $m->content_contains('Object created', 'created Freeform-1' );
    $cfid = $m->form_name('ModifyCustomField')->value('id');
    ok $cfid, "found id of the CF in the form, it's #$cfid";
}

diag "change to Select type";
{
    $m->submit_form(
        form_name => "ModifyCustomField",
        fields    => { TypeComposite => 'Select-1', },
        button    => 'Update',
    );
    $m->content_contains(
        "Type changed from 'Enter one value' to 'Select one value'",
        'changed to Select-1' );
}

diag "let's save it again";
{
    $m->submit_form(
        form_name => "ModifyCustomField",
        button    => 'Update',
    );
    $m->content_lacks( "Render Type changed from '1' to 'Select box'",
        'no buggy RenderType change msg' );
}