diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb
index 3ea40f0..6643354 100644
--- a/app/views/devise/registrations/edit.html.erb
+++ b/app/views/devise/registrations/edit.html.erb
@@ -26,6 +26,12 @@
<%= f.label :current_password %> (we need your current password to confirm your changes)
<%= f.password_field :current_password, autocomplete: "off" %>
+
+
You weigh <%= @profile.weight %>
diff --git a/features/edit_customer_account_details.feature b/features/edit_customer_account_details.feature new file mode 100644 index 0000000..473cd9e --- /dev/null +++ b/features/edit_customer_account_details.feature @@ -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 diff --git a/features/step_definitions/edit_customer_account_details_steps.rb b/features/step_definitions/edit_customer_account_details_steps.rb new file mode 100644 index 0000000..b403cc9 --- /dev/null +++ b/features/step_definitions/edit_customer_account_details_steps.rb @@ -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.") +end +