Bugzilla – Attachment 43696 Details for
Bug 10363
Move authorised value related code into its own package
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10363: Fix tests
Bug-10363-Fix-tests.patch (text/plain), 4.79 KB, created by
Jonathan Druart
on 2015-10-21 14:46:00 UTC
(
hide
)
Description:
Bug 10363: Fix tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-10-21 14:46:00 UTC
Size:
4.79 KB
patch
obsolete
>From 55903959ef010a5505a8fb3d90f1059057c11291 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 21 Oct 2015 15:44:30 +0100 >Subject: [PATCH] Bug 10363: Fix tests > >The delete op is now "delete" and the confirmation is a JS dialog box. > >Note that now this patch removes the categories the tests will add (to >avoid error on inserting duplicate). >--- > t/db_dependent/www/auth_values_input_www.t | 31 +++++++++++++++--------------- > 1 file changed, 16 insertions(+), 15 deletions(-) > >diff --git a/t/db_dependent/www/auth_values_input_www.t b/t/db_dependent/www/auth_values_input_www.t >index 0844fc3..bcb441d 100644 >--- a/t/db_dependent/www/auth_values_input_www.t >+++ b/t/db_dependent/www/auth_values_input_www.t >@@ -48,6 +48,7 @@ if (not defined $intranet) { > plan skip_all => "Tests skip. You must set env. variable KOHA_INTRANET_URL to do tests\n"; > } > >+my $dbh = C4::Context->dbh; > > $intranet =~ s#/$##; > >@@ -69,6 +70,7 @@ $agent->get_ok( "$intranet/cgi-bin/koha/mainpage.pl", 'load main page' ); > #--------------------------------------------------- Test with corean and greek chars > > $category = 'å¦åä¼Î¼Î¼'; >+$dbh->do(q|DELETE FROM authorised_values WHERE category = ?|, undef, $category); > > $agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl", 'Connect to Authorized values page' ); > $agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?op=add_form", 'Open to create a new category' ); >@@ -80,14 +82,14 @@ $agent->field('category', $category); > $agent->field('branches', ''); > $agent->click_ok( '', "Create new auth category and value" ); > >-$expected_base = q|authorised_values.pl\?searchfield=| . uri_escape_utf8( $category ); >+$expected_base = q|authorised_values.pl|; > $agent->base_like(qr|$expected_base|, "check base"); > $add_form_link_exists = 0; > $delete_form_link_exists = 0; > for my $link ( $agent->links() ) { > if ( $link->url =~ m|authorised_values.pl\?op=add_form&category=$category| ) { > $add_form_link_exists = 1; >- }elsif( $link->url =~ m|authorised_values.pl\?op=delete_confirm&searchfield=$category| ) { >+ }elsif( $link->url =~ m|authorised_values.pl\?op=delete&searchfield=$category| ) { > $delete_form_link_exists = 1; > } > } >@@ -105,21 +107,21 @@ my @links = $agent->links; > my $id_to_del =''; > foreach my $dato (@links){ > my $link = $dato->url; >- if ($link =~ m/op=delete_confirm\&searchfield=å¦åä¼Î¼Î¼/){ >- $link =~ m/(.*&id=?)(\d{1,})(&.*)/; >- $id_to_del = $2; >+ if ($link =~ m/op=delete\&searchfield=å¦åä¼Î¼Î¼\&id=(\d+)/){ >+ $id_to_del = $1; > last; >- }; >+ } > } > if ($id_to_del) { >- $agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?op=delete_confirmed&searchfield=å¦åä¼Î¼Î¼&id=$id_to_del", 'UTF_8 auth. value deleted' ); >+ $agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?op=delete&searchfield=å¦åä¼Î¼Î¼&id=$id_to_del", 'UTF_8 auth. value deleted' ); > }else{ >- ok($id_to_del ne undef, "error, link to delete nor working"); >+ ok($id_to_del ne undef, "error, link to delete not working"); > } > > #---------------------------------------- Test with only latin utf-8 (could be taken as Latin-1/ISO 8859-1) > > $category = 'tòmas'; >+$dbh->do(q|DELETE FROM authorised_values WHERE category = ?|, undef, $category); > > $agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl", 'Connect to Authorized values page' ); > $agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?op=add_form", 'Open to create a new category' ); >@@ -140,7 +142,7 @@ $delete_form_link_exists = 0; > for my $link ( $agent->links() ) { > if ( $link->url =~ m|authorised_values.pl\?op=add_form&category=$category| ) { > $add_form_link_exists = 1; >- }elsif( $link->url =~ m|authorised_values.pl\?op=delete_confirm&searchfield=$category| ) { >+ }elsif( $link->url =~ m|authorised_values.pl\?op=delete&searchfield=$category| ) { > $delete_form_link_exists = 1; > } > } >@@ -158,16 +160,15 @@ my @links2 = $agent->links; > my $id_to_del2 =''; > foreach my $dato (@links2){ > my $link = $dato->url; >- if ($link =~ m/op=delete_confirm\&searchfield=tòmas/){ >- $link =~ m/(.*&id=?)(\d{1,})(&.*)/; >- $id_to_del2 = $2; >+ if ($link =~ m/op=delete\&searchfield=tòmas\&id=(\d+)/){ >+ $id_to_del2 = $1; > last; >- }; >+ } > } > if ($id_to_del2) { >- $agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?op=delete_confirmed&searchfield=tòmas&id=$id_to_del2", 'UTF_8 auth. value deleted' ); >+ $agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?op=delete&searchfield=tòmas&id=$id_to_del2", 'UTF_8 auth. value deleted' ); > }else{ >- ok($id_to_del ne undef, "error, link to delete nor working"); >+ ok($id_to_del2 ne undef, "error, link to delete not working"); > } > > 1; >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10363
:
18430
|
18431
|
18432
|
18751
|
18752
|
18753
|
20729
|
21833
|
21834
|
21835
|
21836
|
25284
|
25285
|
25286
|
25287
|
30583
|
30584
|
30585
|
30710
|
30711
|
30712
|
31565
|
32632
|
32633
|
32634
|
33416
|
33417
|
33422
|
33423
|
33860
|
33861
|
33862
|
33889
|
33949
|
35838
|
35839
|
35840
|
35841
|
41290
|
41291
|
41292
|
41293
|
41294
|
41302
|
41343
|
41344
|
41345
|
43112
|
43113
|
43114
|
43550
|
43551
|
43552
|
43553
|
43554
|
43555
|
43556
|
43557
|
43558
|
43559
| 43696 |
43827