From: Tomas Sedovic tsedovic@redhat.com
https://bugzilla.redhat.com/show_bug.cgi?id=642165
Steps: (on the user edit page) 1. Leave the "Change Password" field blank 2. Fill in the "Confirm Password" field with some text 3. Press Save
The test is currently failing. --- src/features/step_definitions/user_steps.rb | 3 +++ src/features/user.feature | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 0 deletions(-) create mode 100644 src/features/step_definitions/user_steps.rb create mode 100644 src/features/user.feature
diff --git a/src/features/step_definitions/user_steps.rb b/src/features/step_definitions/user_steps.rb new file mode 100644 index 0000000..09bbaf8 --- /dev/null +++ b/src/features/step_definitions/user_steps.rb @@ -0,0 +1,3 @@ +Given /^there is a user "([^"]*)"$/ do |name| + @user = User.find_by_login(name) +end diff --git a/src/features/user.feature b/src/features/user.feature new file mode 100644 index 0000000..e11dfba --- /dev/null +++ b/src/features/user.feature @@ -0,0 +1,27 @@ +Feature: Manage Users + In order to manage users + As an admin + I want to add/edit/remove users + + Background: + Given I am an authorised user + And I am logged in + And a user "testuser" exists + + Scenario: Change the password + Given I am on the users page + And there is a user "testuser" + When I follow "testuser" + Then I should see "Editing User:" + When I fill in "user[password]" with "new password" + And I fill in "user[password_confirmation]" with "" + And I press "Save" + Then I should see "Password doesn't match confirmation" + When I fill in "user[password]" with "" + And I fill in "user[password_confirmation]" with "new password" + And I press "Save" + Then I should see "Password doesn't match confirmation" + When I fill in "user[password]" with "new password" + And I fill in "user[password_confirmation]" with "new password" + And I press "Save" + Then I should see "User updated!"