projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'patch-5' of https://github.com/gjones2/Freeside (#13854 as this bug...
[freeside.git]
/
rt
/
t
/
web
/
cf_select_one.t
diff --git
a/rt/t/web/cf_select_one.t
b/rt/t/web/cf_select_one.t
index
26c1fcf
..
15fe416
100644
(file)
--- a/
rt/t/web/cf_select_one.t
+++ b/
rt/t/web/cf_select_one.t
@@
-3,7
+3,7
@@
use strict;
use warnings;
use strict;
use warnings;
-use RT::Test tests => 4
6
;
+use RT::Test tests => 4
5
;
my ($baseurl, $m) = RT::Test->started_ok;
ok $m->login, 'logged in as root';
my ($baseurl, $m) = RT::Test->started_ok;
ok $m->login, 'logged in as root';
@@
-11,13
+11,9
@@
ok $m->login, 'logged in as root';
my $cf_name = 'test select one value';
my $cfid;
my $cf_name = 'test select one value';
my $cfid;
-diag "Create a CF"
if $ENV{'TEST_VERBOSE'}
;
+diag "Create a CF";
{
{
- $m->follow_link( text => 'Configuration' );
- $m->title_is(q/RT Administration/, 'admin screen');
- $m->follow_link( text => 'Custom Fields' );
- $m->title_is(q/Select a Custom Field/, 'admin-cf screen');
- $m->follow_link( text => 'Create' );
+ $m->follow_link( id => 'tools-config-custom-fields-create');
$m->submit_form(
form_name => "ModifyCustomField",
fields => {
$m->submit_form(
form_name => "ModifyCustomField",
fields => {
@@
-26,12
+22,12
@@
diag "Create a CF" if $ENV{'TEST_VERBOSE'};
LookupType => 'RT::Queue-RT::Ticket',
},
);
LookupType => 'RT::Queue-RT::Ticket',
},
);
- $m->content_
like( qr/Object created/
, 'created CF sucessfully' );
+ $m->content_
contains('Object created'
, 'created CF sucessfully' );
$cfid = $m->form_name('ModifyCustomField')->value('id');
ok $cfid, "found id of the CF in the form, it's #$cfid";
}
$cfid = $m->form_name('ModifyCustomField')->value('id');
ok $cfid, "found id of the CF in the form, it's #$cfid";
}
-diag "add 'qwe', 'ASD', '0' and ' foo ' as values to the CF"
if $ENV{'TEST_VERBOSE'}
;
+diag "add 'qwe', 'ASD', '0' and ' foo ' as values to the CF";
{
foreach my $value(qw(qwe ASD 0), 'foo ') {
$m->submit_form(
{
foreach my $value(qw(qwe ASD 0), 'foo ') {
$m->submit_form(
@@
-41,38
+37,36
@@
diag "add 'qwe', 'ASD', '0' and ' foo ' as values to the CF" if $ENV{'TEST_VERBO
},
button => 'Update',
);
},
button => 'Update',
);
- $m->content_
like( qr/Object created/
, 'added a value to the CF' ); # or diag $m->content;
+ $m->content_
contains('Object created'
, 'added a value to the CF' ); # or diag $m->content;
my $v = $value;
$v =~ s/^\s+$//;
$v =~ s/\s+$//;
my $v = $value;
$v =~ s/^\s+$//;
$v =~ s/\s+$//;
- $m->content_
like( qr/value="$v"/
, 'the added value is right' );
+ $m->content_
contains("value=\"$v\""
, 'the added value is right' );
}
}
my $queue = RT::Test->load_or_create_queue( Name => 'General' );
ok $queue && $queue->id, 'loaded or created queue';
}
}
my $queue = RT::Test->load_or_create_queue( Name => 'General' );
ok $queue && $queue->id, 'loaded or created queue';
-diag "apply the CF to General queue"
if $ENV{'TEST_VERBOSE'}
;
+diag "apply the CF to General queue";
{
{
- $m->follow_link( text => 'Queues' );
- $m->title_is(q/Admin queues/, 'admin-queues screen');
+ $m->follow_link( id => 'tools-config-queues');
$m->follow_link( text => 'General' );
$m->follow_link( text => 'General' );
- $m->title_is(q/
Editing
Configuration for queue General/, 'admin-queue: general');
- $m->follow_link(
text => 'Ticket Custom Fields'
);
- $m->title_is(q/
Edit Custom Fields for
General/, 'admin-queue: general cfid');
+ $m->title_is(q/Configuration for queue General/, 'admin-queue: general');
+ $m->follow_link(
id => 'page-ticket-custom-fields'
);
+ $m->title_is(q/
Custom Fields for queue
General/, 'admin-queue: general cfid');
$m->form_name('EditCustomFields');
$m->tick( "AddCustomField" => $cfid );
$m->click('UpdateCFs');
$m->form_name('EditCustomFields');
$m->tick( "AddCustomField" => $cfid );
$m->click('UpdateCFs');
- $m->content_
like( qr/Object created/
, 'TCF added to the queue' );
+ $m->content_
contains('Object created'
, 'TCF added to the queue' );
}
my $tid;
}
my $tid;
-diag "create a ticket using API with 'asd'(not 'ASD') as value of the CF"
- if $ENV{'TEST_VERBOSE'};
+diag "create a ticket using API with 'asd'(not 'ASD') as value of the CF";
{
{
- my $ticket = RT::Ticket->new(
$RT::
SystemUser );
+ my $ticket = RT::Ticket->new(
RT->
SystemUser );
my ($txnid, $msg);
($tid, $txnid, $msg) = $ticket->Create(
Subject => 'test',
my ($txnid, $msg);
($tid, $txnid, $msg) = $ticket->Create(
Subject => 'test',
@@
-80,7
+74,7
@@
diag "create a ticket using API with 'asd'(not 'ASD') as value of the CF"
"CustomField-$cfid" => 'asd',
);
ok $tid, "created ticket";
"CustomField-$cfid" => 'asd',
);
ok $tid, "created ticket";
- diag $msg if $msg
&& $ENV{'TEST_VERBOSE'}
;
+ diag $msg if $msg;
# we use lc as we really don't care about case
# so if later we'll add canonicalization of value
# we use lc as we really don't care about case
# so if later we'll add canonicalization of value
@@
-89,72
+83,69
@@
diag "create a ticket using API with 'asd'(not 'ASD') as value of the CF"
'asd', 'assigned value of the CF';
}
'asd', 'assigned value of the CF';
}
-diag "check that values of the CF are case insensetive(asd vs. ASD)"
- if $ENV{'TEST_VERBOSE'};
+diag "check that values of the CF are case insensetive(asd vs. ASD)";
{
ok $m->goto_ticket( $tid ), "opened ticket's page";
{
ok $m->goto_ticket( $tid ), "opened ticket's page";
- $m->follow_link(
text => 'Custom Fields'
);
+ $m->follow_link(
id => 'page-basics'
);
$m->title_like(qr/Modify ticket/i, 'modify ticket');
$m->title_like(qr/Modify ticket/i, 'modify ticket');
- $m->content_
like(qr/\Q$cf_name/
, 'CF on the page');
+ $m->content_
contains($cf_name
, 'CF on the page');
- my $value = $m->form_n
umber(3
)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
+ my $value = $m->form_n
ame('TicketModify'
)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
is lc $value, 'asd', 'correct value is selected';
$m->submit;
$m->content_unlike(qr/\Q$cf_name\E.*?changed/mi, 'field is not changed');
is lc $value, 'asd', 'correct value is selected';
$m->submit;
$m->content_unlike(qr/\Q$cf_name\E.*?changed/mi, 'field is not changed');
- $value = $m->form_n
umber(3
)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
+ $value = $m->form_n
ame('TicketModify'
)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
is lc $value, 'asd', 'the same value is still selected';
is lc $value, 'asd', 'the same value is still selected';
- my $ticket = RT::Ticket->new(
$RT::
SystemUser );
+ my $ticket = RT::Ticket->new(
RT->
SystemUser );
$ticket->Load( $tid );
ok $ticket->id, 'loaded the ticket';
is lc $ticket->FirstCustomFieldValue( $cf_name ),
'asd', 'value is still the same';
}
$ticket->Load( $tid );
ok $ticket->id, 'loaded the ticket';
is lc $ticket->FirstCustomFieldValue( $cf_name ),
'asd', 'value is still the same';
}
-diag "check that 0 is ok value of the CF"
- if $ENV{'TEST_VERBOSE'};
+diag "check that 0 is ok value of the CF";
{
ok $m->goto_ticket( $tid ), "opened ticket's page";
{
ok $m->goto_ticket( $tid ), "opened ticket's page";
- $m->follow_link(
text => 'Custom Fields'
);
+ $m->follow_link(
id => 'page-basics'
);
$m->title_like(qr/Modify ticket/i, 'modify ticket');
$m->title_like(qr/Modify ticket/i, 'modify ticket');
- $m->content_
like(qr/\Q$cf_name/
, 'CF on the page');
+ $m->content_
contains($cf_name
, 'CF on the page');
- my $value = $m->form_n
umber(3
)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
+ my $value = $m->form_n
ame('TicketModify'
)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
is lc $value, 'asd', 'correct value is selected';
$m->select("Object-RT::Ticket-$tid-CustomField-$cfid-Values" => 0 );
$m->submit;
$m->content_like(qr/\Q$cf_name\E.*?changed/mi, 'field is changed');
is lc $value, 'asd', 'correct value is selected';
$m->select("Object-RT::Ticket-$tid-CustomField-$cfid-Values" => 0 );
$m->submit;
$m->content_like(qr/\Q$cf_name\E.*?changed/mi, 'field is changed');
- $m->content_
unlike(qr/0 is no longer a value for custom field/mi
, 'no bad message in results');
+ $m->content_
lacks('0 is no longer a value for custom field'
, 'no bad message in results');
- $value = $m->form_n
umber(3
)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
+ $value = $m->form_n
ame('TicketModify'
)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
is lc $value, '0', 'new value is selected';
is lc $value, '0', 'new value is selected';
- my $ticket = RT::Ticket->new(
$RT::
SystemUser );
+ my $ticket = RT::Ticket->new(
RT->
SystemUser );
$ticket->Load( $tid );
ok $ticket->id, 'loaded the ticket';
is lc $ticket->FirstCustomFieldValue( $cf_name ),
'0', 'API returns correct value';
}
$ticket->Load( $tid );
ok $ticket->id, 'loaded the ticket';
is lc $ticket->FirstCustomFieldValue( $cf_name ),
'0', 'API returns correct value';
}
-diag "check that we can set empty value when the current is 0"
- if $ENV{'TEST_VERBOSE'};
+diag "check that we can set empty value when the current is 0";
{
ok $m->goto_ticket( $tid ), "opened ticket's page";
{
ok $m->goto_ticket( $tid ), "opened ticket's page";
- $m->follow_link(
text => 'Custom Fields'
);
+ $m->follow_link(
id => 'page-basics'
);
$m->title_like(qr/Modify ticket/i, 'modify ticket');
$m->title_like(qr/Modify ticket/i, 'modify ticket');
- $m->content_
like(qr/\Q$cf_name/
, 'CF on the page');
+ $m->content_
contains($cf_name
, 'CF on the page');
- my $value = $m->form_n
umber(3
)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
+ my $value = $m->form_n
ame('TicketModify'
)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
is lc $value, '0', 'correct value is selected';
$m->select("Object-RT::Ticket-$tid-CustomField-$cfid-Values" => '' );
$m->submit;
is lc $value, '0', 'correct value is selected';
$m->select("Object-RT::Ticket-$tid-CustomField-$cfid-Values" => '' );
$m->submit;
- $m->content_
like(qr/0 is no longer a value for custom field/mi
, '0 is no longer a value');
+ $m->content_
contains('0 is no longer a value for custom field'
, '0 is no longer a value');
- $value = $m->form_n
umber(3
)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
+ $value = $m->form_n
ame('TicketModify'
)->value("Object-RT::Ticket-$tid-CustomField-$cfid-Values");
is $value, '', '(no value) is selected';
is $value, '', '(no value) is selected';
- my $ticket = RT::Ticket->new(
$RT::
SystemUser );
+ my $ticket = RT::Ticket->new(
RT->
SystemUser );
$ticket->Load( $tid );
ok $ticket->id, 'loaded the ticket';
is $ticket->FirstCustomFieldValue( $cf_name ),
$ticket->Load( $tid );
ok $ticket->id, 'loaded the ticket';
is $ticket->FirstCustomFieldValue( $cf_name ),