Update Account::Profile tests and code.
This commit is contained in:
parent
431cd280a4
commit
38d35e23b6
3 changed files with 4 additions and 5 deletions
|
|
@ -21,7 +21,7 @@ has method => (
|
||||||
|
|
||||||
has uid => (
|
has uid => (
|
||||||
is => 'rw',
|
is => 'rw',
|
||||||
default => 'view',
|
default => '',
|
||||||
);
|
);
|
||||||
|
|
||||||
has bare => (
|
has bare => (
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ use WebGUI::International;
|
||||||
use WebGUI::Pluggable;
|
use WebGUI::Pluggable;
|
||||||
use WebGUI::ProfileCategory;
|
use WebGUI::ProfileCategory;
|
||||||
use WebGUI::ProfileField;
|
use WebGUI::ProfileField;
|
||||||
|
use WebGUI::Shop::AddressBook;
|
||||||
use base qw/WebGUI::Account/;
|
use base qw/WebGUI::Account/;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
@ -462,9 +463,7 @@ sub www_editSave {
|
||||||
if($e = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound')) {
|
if($e = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound')) {
|
||||||
#Get home address only mappings to avoid creating addresses with just firstName, lastName, email
|
#Get home address only mappings to avoid creating addresses with just firstName, lastName, email
|
||||||
my %home_address_map = %{$address_mappings};
|
my %home_address_map = %{$address_mappings};
|
||||||
foreach my $exclude ( qw{ firstName lastName email } ) {
|
delete $home_address_map{qw/firstName lastName email/};
|
||||||
delete $home_address_map{$exclude};
|
|
||||||
}
|
|
||||||
#Add the profile address for the user if there are homeAddress fields
|
#Add the profile address for the user if there are homeAddress fields
|
||||||
if( grep { $address->{$_} } values %home_address_map ) {
|
if( grep { $address->{$_} } values %home_address_map ) {
|
||||||
$address->{label} = "Profile Address";
|
$address->{label} = "Profile Address";
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ $andy = $session->user;
|
||||||
|
|
||||||
#Test that the address was saved to the profile
|
#Test that the address was saved to the profile
|
||||||
cmp_bag (
|
cmp_bag (
|
||||||
[ map { $andy->profileField($_) } keys %profile_info ],
|
[ map { $andy->get($_) } keys %profile_info ],
|
||||||
[ values %profile_info ],
|
[ values %profile_info ],
|
||||||
'Profile fields were updated'
|
'Profile fields were updated'
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue