Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Not Specified" as a gender option when customer does not specify gender #1496

Merged
merged 4 commits into from
Sep 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/code/Magento/Customer/Setup/CustomerSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public function getDefaultEntities()
'validate_rules' => 'a:0:{}',
'position' => 110,
'admin_checkout' => 1,
'option' => ['values' => ['Male', 'Female']],
'option' => ['values' => ['Male', 'Female', 'Not Specified']],
],
'disable_auto_group_change' => [
'type' => 'static',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ public function testGetCustomer()
*/
public function testGetGenderOptions()
{
$options = [['label' => __('Male'), 'value' => 'M'], ['label' => __('Female'), 'value' => 'F']];
$options = [
['label' => __('Male'), 'value' => 'M'],
['label' => __('Female'), 'value' => 'F'],
['label' => __('Not Specified'), 'value' => 'NA']
];

$this->attribute->expects($this->once())->method('getOptions')->will($this->returnValue($options));
$this->assertSame($options, $this->block->getGenderOptions());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public function getAttributeMetadataDataProvider()
['label' => '', 'value' => ''],
['label' => 'Male', 'value' => '1'],
['label' => 'Female', 'value' => '2'],
['label' => 'Not Specified', 'value' => '3']
],
AttributeMetadata::FRONTEND_CLASS => '',
AttributeMetadata::FRONTEND_LABEL => 'Gender',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class Curl extends AbstractCurl implements CustomerInterface
'gender' => [
'Male' => 1,
'Female' => 2,
'Not Specified' => 3
],
'region_id' => [
'California' => 12,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ public function testToHtml()
$this->assertContains('<span>Gender</span>', $html);
$this->assertContains('<option value="1">Male</option>', $html);
$this->assertContains('<option value="2">Female</option>', $html);
$this->assertContains('<option value="3">Not Specified</option>', $html);
}
}