Skip to content

Commit 38d35e2

Browse files
committedNov 1, 2011
Update Account::Profile tests and code.
1 parent 431cd28 commit 38d35e2

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed
 

‎lib/WebGUI/Account.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ has method => (
2121

2222
has uid => (
2323
is => 'rw',
24-
default => 'view',
24+
default => '',
2525
);
2626

2727
has bare => (

‎lib/WebGUI/Account/Profile.pm

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use WebGUI::International;
77
use WebGUI::Pluggable;
88
use WebGUI::ProfileCategory;
99
use WebGUI::ProfileField;
10+
use WebGUI::Shop::AddressBook;
1011
use base qw/WebGUI::Account/;
1112

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

‎t/Account/Profile.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ $andy = $session->user;
173173

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

0 commit comments

Comments
 (0)
Please sign in to comment.