Bugzilla – Attachment 67486 Details for
Bug 19391
auth_values_input_www.t is failing because of bug 19128
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19391: (bug 19128 follow-up) Fix failing tests from auth_values_input_www.t
Bug-19391-bug-19128-follow-up-Fix-failing-tests-fr.patch (text/plain), 6.58 KB, created by
Jonathan Druart
on 2017-09-29 19:17:50 UTC
(
hide
)
Description:
Bug 19391: (bug 19128 follow-up) Fix failing tests from auth_values_input_www.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-09-29 19:17:50 UTC
Size:
6.58 KB
patch
obsolete
>From 8d8019ef8662b86cd4de1e2b05b619df94184e43 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 29 Sep 2017 16:16:56 -0300 >Subject: [PATCH] Bug 19391: (bug 19128 follow-up) Fix failing tests from > auth_values_input_www.t > >--- > .../prog/en/modules/admin/authorised_values.tt | 4 ++-- > t/db_dependent/www/auth_values_input_www.t | 26 +++++++++++++--------- > 2 files changed, 18 insertions(+), 12 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >index 5c17e5ddfd..8dd1d7bbfa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >@@ -292,7 +292,7 @@ $(document).ready(function() { > [% END %] > </td> > <td class="actions"><a href="/cgi-bin/koha/admin/authorised_values.pl?op=add_form&id=[% loo.id %]" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a> >- <a class="delete btn btn-default btn-xs" href="/cgi-bin/koha/admin/authorised_values.pl?op=delete&searchfield=[% searchfield %]&id=[% loo.id %]"><i class="fa fa-trash"></i> Delete</a></td> >+ <a class="delete btn btn-default btn-xs" href="/cgi-bin/koha/admin/authorised_values.pl?op=delete&searchfield=[% searchfield | url %]&id=[% loo.id %]"><i class="fa fa-trash"></i> Delete</a></td> > </tr> > [% END %] > </tbody></table>[% ELSE %] >@@ -301,7 +301,7 @@ $(document).ready(function() { > > [% IF ( isprevpage ) %] > <form class="inline" action="/cgi-bin/koha/admin/authorised_values.pl" method="post"> >-<input type="hidden" name="searchfield" value="[% searchfield %]" /> >+<input type="hidden" name="searchfield" value="[% searchfield | html %]" /> > <input type="submit" value="<< Previous" /></form> > [% END %] > >diff --git a/t/db_dependent/www/auth_values_input_www.t b/t/db_dependent/www/auth_values_input_www.t >index bcb65d16d2..e40d7e45d3 100644 >--- a/t/db_dependent/www/auth_values_input_www.t >+++ b/t/db_dependent/www/auth_values_input_www.t >@@ -83,12 +83,12 @@ $agent->click_ok( '', "Create new AV category " ); > $agent->base_like(qr|$expected_base|, "check base"); > $add_form_link_exists = 0; > for my $link ( $agent->links() ) { >- if ( $link->url =~ m|authorised_values.pl\?op=add_form&category=$category| ) { >+ if ( $link->url =~ m|authorised_values.pl\?op=add_form&category=| . uri_escape_utf8($category) ) { > $add_form_link_exists = 1; > } > } > is( $add_form_link_exists, 1, 'Add a new category button should be displayed'); >-$agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?op=add_form&category=$category", 'Open to create a new AV for this category' ); >+$agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?op=add_form&category=" . uri_escape_utf8($category), 'Open to create a new AV for this category' ); > > $agent->form_name('Aform'); > $agent->field('authorised_value', 'εÏιμεq'); >@@ -100,10 +100,12 @@ $agent->click_ok( '', "Create a new value for the category" ); > $agent->base_like(qr|$expected_base|, "check base"); > $add_form_link_exists = 0; > $delete_form_link_exists = 0; >+my $add_form_re = q|authorised_values.pl\?op=add_form&category=| . uri_escape_utf8($category); >+my $delete_re = q|authorised_values.pl\?op=delete&searchfield=| . uri_escape_utf8($category); > for my $link ( $agent->links() ) { >- if ( $link->url =~ m|authorised_values.pl\?op=add_form&category=$category| ) { >+ if ( $link->url =~ qr|$add_form_re| ) { > $add_form_link_exists = 1; >- }elsif( $link->url =~ m|authorised_values.pl\?op=delete&searchfield=$category| ) { >+ } elsif ( $link->url =~ qr|$delete_re| ) { > $delete_form_link_exists = 1; > } > } >@@ -111,7 +113,7 @@ is( $add_form_link_exists, 1, 'Add a new category button should be displayed'); > is( $delete_form_link_exists, 1, ''); > > $agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl", 'Return to Authorized values page' ); >-$agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?searchfield=å¦åä¼Î¼Î¼&offset=0", 'Search the values inserted' ); >+$agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?searchfield=" . uri_escape_utf8($category) . "&offset=0", 'Search the values inserted' ); > my $text = $agent->text() ; > #Tests on UTF-8 > ok ( ( length(Encode::encode('UTF-8', $text)) != length($text) ) , 'UTF-8 are multi-byte. Good') ; >@@ -119,15 +121,16 @@ ok ($text =~ m/å¦åä¼Î¼Î¼/, 'UTF-8 (Asia) chars are correctly present. Good' > ok ($text =~ m/εÏιμεq/, 'UTF-8 (Greek) chars are correctly present. Good'); > my @links = $agent->links; > my $id_to_del =''; >+$delete_re = q|op=delete\&searchfield=| . uri_escape_utf8($category) . '\&id=(\d+)'; > foreach my $dato (@links){ > my $link = $dato->url; >- if ($link =~ m/op=delete\&searchfield=å¦åä¼Î¼Î¼\&id=(\d+)/){ >+ if ($link =~ qr|$delete_re| ) { > $id_to_del = $1; > last; > } > } > if ($id_to_del) { >- $agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?op=delete&searchfield=å¦åä¼Î¼Î¼&id=$id_to_del", 'UTF_8 auth. value deleted' ); >+ $agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?op=delete&searchfield=" . uri_escape_utf8($category) . "&id=$id_to_del", 'UTF_8 auth. value deleted' ); > }else{ > ok($id_to_del ne undef, "error, link to delete not working"); > } >@@ -156,10 +159,12 @@ $expected_base = q|authorised_values.pl|; > $agent->base_like(qr|$expected_base|, "check base"); > $add_form_link_exists = 0; > $delete_form_link_exists = 0; >+$add_form_re = q|authorised_values.pl\?op=add_form&category=| . uri_escape_utf8($category); >+$delete_re = q|authorised_values.pl\?op=delete&searchfield=| . uri_escape_utf8($category); > for my $link ( $agent->links() ) { >- if ( $link->url =~ m|authorised_values.pl\?op=add_form&category=$category| ) { >+ if ( $link->url =~ qr|$add_form_re| ) { > $add_form_link_exists = 1; >- }elsif( $link->url =~ m|authorised_values.pl\?op=delete&searchfield=$category| ) { >+ }elsif( $link->url =~ qr|$delete_re| ) { > $delete_form_link_exists = 1; > } > } >@@ -175,9 +180,10 @@ ok ($text2 =~ m/tòmas/, 'UTF-8 not Latin-1 first test is OK. Good'); > ok ($text2=~ m/rà men/, 'UTF-8 not Latin-1 second test is OK. Good'); > my @links2 = $agent->links; > my $id_to_del2 =''; >+$delete_re = q|op=delete\&searchfield=| . uri_escape_utf8($category) . q|\&id=(\d+)|; > foreach my $dato (@links2){ > my $link = $dato->url; >- if ($link =~ m/op=delete\&searchfield=tòmas\&id=(\d+)/){ >+ if ($link =~ qr|$delete_re| ){ > $id_to_del2 = $1; > last; > } >-- >2.11.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 19391
: 67486