Skip to content
Open
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
6 changes: 6 additions & 0 deletions app/views/devise/registrations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password, autocomplete: "off" %>
</div>

<div class="field">
<%= f.label :date_of_birth, "Date of Birth" %><br />
<%= f.date_field :date_of_birth, autofocus: true %>
</div>


<div class="actions">
<%= f.submit "Update" %>
Expand Down
10 changes: 5 additions & 5 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
<%= f.email_field :email, autofocus: true %>
</div>

<div class="field">
<%= f.label :date_of_birth, "Date of Birth" %><br />
<%= f.date_field :date_of_birth, autofocus: true %>
</div>

<div class="field">
<%= f.label :password %>
<% if @minimum_password_length %>
Expand All @@ -31,6 +26,11 @@
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>

<div class="field">
<%= f.label :date_of_birth, "Date of Birth" %><br />
<%= f.date_field :date_of_birth, autofocus: true %>
</div>

<div class="actions">
<%= f.submit "Sign up" %>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/views/profiles/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<% for attribute in @profile.display_attribute_keys %>
<li><%= attribute.humanize %>: <%= @profile.attributes[attribute].to_s %></li>
<% end %>
</ul>

<%= render 'profiles/search' %>


<p>You weigh <%= @profile.weight %></p>
12 changes: 12 additions & 0 deletions features/edit_customer_account_details.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Feature: A customer edits their account details

Background:
Given they have a profile
And they have signed in

Scenario: A customer edits their date of birth
When they visit the edit customer registration page
And they fill in their password
And they edit their date of birth
And they click Update
Then their changes are saved to their account
20 changes: 20 additions & 0 deletions features/step_definitions/edit_customer_account_details_steps.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
When(/^they visit the edit customer registration page$/) do
visit edit_customer_registration_path
end

When(/^they fill in their password$/) do
fill_in "Current password", with: "password"
end

When(/^they edit their date of birth$/) do
fill_in "Date of Birth", with: 27.years.ago
end

When(/^they click Update$/) do
click_on "Update"
end

Then(/^their changes are saved to their account$/) do
expect(page).to have_content("Your account has been updated successfully.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check that the DOB was actually saved too ?

end