diff --git a/features/change_password.feature b/features/change_password.feature new file mode 100644 index 0000000000000000000000000000000000000000..d0ee0fe248babb4b3dab8bcb1da20a98701cea51 --- /dev/null +++ b/features/change_password.feature @@ -0,0 +1,18 @@ +@javascript +Feature: Change password + + Scenario: Change my password + Given I am signed in + And I click on my name in the header + And I follow "account settings" + Then I should be on my account settings page + When I fill in "user_password" with "newsecret" + And I fill in "user_password_confirmation" with "newsecret" + And I press "Change Password" + Then I should see "Password Changed" + And I click on my name in the header + And I follow "logout" + Then I should be on the home page + And I sign in with password "newsecret" + Then I should be on the aspects page + \ No newline at end of file diff --git a/features/step_definitions/session_steps.rb b/features/step_definitions/session_steps.rb index 53cdf9f992ff12991360c3d9443c040dc43452f0..4467482620df3e0b2db1f3fd5cdab47b1a0afbd0 100644 --- a/features/step_definitions/session_steps.rb +++ b/features/step_definitions/session_steps.rb @@ -24,3 +24,9 @@ When /^I sign in as "([^"]*)"$/ do |email| @me.password ||= 'password' Given 'I am signed in' end + +When /^I sign in with password "([^"]*)"$/ do |password| + @me.password = password + Given 'I am signed in' +end + diff --git a/features/support/paths.rb b/features/support/paths.rb index 39d4e20baf979a68cf7b9fb05efd1d3531d927be..a9f47def64a464c0ec73a9bc8350a499473b43bd 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -15,6 +15,8 @@ module NavigationHelpers person_path(Request.to(@me).first.from) when /^"([^\"]*)"'s page$/ person_path(User.find_by_email($1).person) + when /^my account settings page$/ + edit_user_path(@me) when /^"(\/.*)"/ $1 else