From 524149c9b24cd7467ed427e6af308fc261817126 Mon Sep 17 00:00:00 2001 From: Jairo Diaz Date: Fri, 7 Jan 2011 10:20:42 -0500 Subject: [PATCH 1/2] Added test for changing password --- features/change_password.feature | 20 ++++++++++++++++++++ features/step_definitions/session_steps.rb | 6 ++++++ features/support/paths.rb | 2 ++ 3 files changed, 28 insertions(+) create mode 100644 features/change_password.feature diff --git a/features/change_password.feature b/features/change_password.feature new file mode 100644 index 000000000..990e2b9ab --- /dev/null +++ b/features/change_password.feature @@ -0,0 +1,20 @@ +@javascript @wip +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 53cdf9f99..446748262 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 39d4e20ba..a9f47def6 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 From d0c1c087f4e17475b35423c6d08176b94fb182f3 Mon Sep 17 00:00:00 2001 From: Jairo Diaz Date: Fri, 7 Jan 2011 10:27:38 -0500 Subject: [PATCH 2/2] removed @wip tag in feature to avoid clash with others --- features/change_password.feature | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/features/change_password.feature b/features/change_password.feature index 990e2b9ab..d0ee0fe24 100644 --- a/features/change_password.feature +++ b/features/change_password.feature @@ -1,4 +1,4 @@ -@javascript @wip +@javascript Feature: Change password Scenario: Change my password @@ -9,12 +9,10 @@ Feature: Change password 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" - + 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 - + 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