Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update Account::Profile tests and code.
  • Loading branch information
perlDreamer committed Nov 1, 2011
1 parent 431cd28 commit 38d35e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/WebGUI/Account.pm
Expand Up @@ -21,7 +21,7 @@ has method => (

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

has bare => (
Expand Down
5 changes: 2 additions & 3 deletions lib/WebGUI/Account/Profile.pm
Expand Up @@ -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
Expand Down Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion t/Account/Profile.t
Expand Up @@ -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'
);
Expand Down

0 comments on commit 38d35e2

Please sign in to comment.