Skip to content
Permalink
Browse files

Update Account::Profile tests and code.

  • Loading branch information...
perlDreamer committed Nov 1, 2011
1 parent 431cd28 commit 38d35e23b66421bb8c05beffe3a42fa0986e4e0a
Showing with 4 additions and 5 deletions.
  1. +1 −1 lib/WebGUI/Account.pm
  2. +2 −3 lib/WebGUI/Account/Profile.pm
  3. +1 −1 t/Account/Profile.t
@@ -21,7 +21,7 @@ has method => (

has uid => (
is => 'rw',
default => 'view',
default => '',
);

has bare => (
@@ -7,6 +7,7 @@ use WebGUI::International;
use WebGUI::Pluggable;
use WebGUI::ProfileCategory;
use WebGUI::ProfileField;
use WebGUI::Shop::AddressBook;
use base qw/WebGUI::Account/;

=head1 NAME
@@ -462,9 +463,7 @@ sub www_editSave {
if($e = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound')) {
#Get home address only mappings to avoid creating addresses with just firstName, lastName, email
my %home_address_map = %{$address_mappings};
foreach my $exclude ( qw{ firstName lastName email } ) {
delete $home_address_map{$exclude};
}
delete $home_address_map{qw/firstName lastName email/};
#Add the profile address for the user if there are homeAddress fields
if( grep { $address->{$_} } values %home_address_map ) {
$address->{label} = "Profile Address";
@@ -173,7 +173,7 @@ $andy = $session->user;

#Test that the address was saved to the profile
cmp_bag (
[ map { $andy->profileField($_) } keys %profile_info ],
[ map { $andy->get($_) } keys %profile_info ],
[ values %profile_info ],
'Profile fields were updated'
);

0 comments on commit 38d35e2

Please sign in to comment.
You can’t perform that action at this time.