From 7ec50fa4f05ccbcd5405c301b88c1f21ec9a6cfc Mon Sep 17 00:00:00 2001 From: JG Date: Mon, 23 May 2022 13:27:58 +0100 Subject: [PATCH] code for change password scenario --- features/step_definitions/data_coordinator_steps.rb | 10 ++++++---- features/users/data_coordinator.feature | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/features/step_definitions/data_coordinator_steps.rb b/features/step_definitions/data_coordinator_steps.rb index 8de6599c2..ab7fcf627 100644 --- a/features/step_definitions/data_coordinator_steps.rb +++ b/features/step_definitions/data_coordinator_steps.rb @@ -47,17 +47,19 @@ Then("the no links in navigation bar are highlighted") do end When("I click to change my password") do - pending # Write code here that turns the phrase above into concrete actions + find('[data-qa="change-password"]').click end When("I fill in new password and confirmation") do - pending # Write code here that turns the phrase above into concrete actions + fill_in("user[password]", with: "Password123!") + fill_in("user[password_confirmation]", with: "Password123!") end When("I click to update my password") do - pending # Write code here that turns the phrase above into concrete actions + click_button("Update") end Then("my password should be updated") do - pending # Write code here that turns the phrase above into concrete actions + expect(page).to have_current_path("/account") + expect(User.find(@user.id).valid_password?("Password123!")).to be true end diff --git a/features/users/data_coordinator.feature b/features/users/data_coordinator.feature index a7647fd87..f570f5d34 100644 --- a/features/users/data_coordinator.feature +++ b/features/users/data_coordinator.feature @@ -18,7 +18,6 @@ Feature: Data Coordinator Features Then I see information about my account And the no links in navigation bar are highlighted - @wip Scenario: Changing your password When I visit the your account page And I click to change my password