Fix settings test, and a bug in the Gender setting module.
Patch by kareila.
diffs (39 lines):
diff -r b08e1279c61b -r f359f9ff8358 cgi-bin/LJ/Setting/Gender.pm
--- a/cgi-bin/LJ/Setting/Gender.pm Tue Apr 20 09:25:50 2010 +0000
+++ b/cgi-bin/LJ/Setting/Gender.pm Tue Apr 20 09:29:50 2010 +0000
@@ -44,7 +44,7 @@ sub error_check {
sub error_check {
my ( $class, $u, $args ) = @_;
my $val = $class->get_arg( $args, "gender" );
- $class->errors( access => $class->ml( '.setting.gender.error.wrongtype' )
) if $u->is_individual;
+ $class->errors( access => $class->ml( '.setting.gender.error.wrongtype' )
) unless $u->is_individual;
$class->errors( gender => $class->ml( '.setting.gender.error.invalid' ) )
unless $val =~ /^[UMFO]$/;
return 1;
}
diff -r b08e1279c61b -r f359f9ff8358 t/settings.t
--- a/t/settings.t Tue Apr 20 09:25:50 2010 +0000
+++ b/t/settings.t Tue Apr 20 09:29:50 2010 +0000
@@ -6,22 +6,18 @@ require 'ljlib.pl';
require 'ljlib.pl';
use LJ::Lang;
-#plan tests => ;
-plan skip_all => 'Fix this test! LJ/Setting/WebpageURL.pm is missing';
+plan tests => 9;
package LJ;
require 'htmlcontrols.pl';
package main;
-#use LJ::Setting::WebpageURL;
use LJ::Setting::Gender;
use LJ::Setting::Name;
-my $webkey = LJ::Setting::WebpageURL->pkgkey;
my $genkey = LJ::Setting::Gender->pkgkey;
my $namekey = LJ::Setting::Name->pkgkey;
-is($webkey, "LJ__Setting__WebpageURL_", "key check");
is($genkey, "LJ__Setting__Gender_", "key check");
my $u = LJ::load_user("system");
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog