diff options
author | Patricio Cano <patricio@gitlab.com> | 2014-10-24 17:19:35 -0500 |
---|---|---|
committer | Patricio Cano <patricio@gitlab.com> | 2014-10-24 17:19:35 -0500 |
commit | 000af8d5d7087cadbfd8ad677fb941e74a8ee3c7 (patch) | |
tree | b55b4d6df23e4cfc64daa387dff2e0b2d1ab2ec1 /features | |
parent | 7fbc4f5b3ac2abfa8ad94cc228114462b7b94601 (diff) | |
download | gitlab-ce-000af8d5d7087cadbfd8ad677fb941e74a8ee3c7.tar.gz |
Moved require from application.js to password_strength.js
Corrected div id for profile password/edit
Added first spinach tests
Diffstat (limited to 'features')
-rw-r--r-- | features/profile/profile.feature | 19 | ||||
-rw-r--r-- | features/steps/profile/profile.rb | 34 |
2 files changed, 53 insertions, 0 deletions
diff --git a/features/profile/profile.feature b/features/profile/profile.feature index d2125e013bc..d7fa370fe2a 100644 --- a/features/profile/profile.feature +++ b/features/profile/profile.feature @@ -83,3 +83,22 @@ Feature: Profile Given I visit profile design page When I change my code preview theme Then I should receive feedback that the changes were saved + + @javascript + Scenario: I see the password strength indicator + Given I visit profile password page + When I try to set a weak password + Then I should see the input field yellow + + @javascript + Scenario: I see the password strength indicator error + Given I visit profile password page + When I try to set a short password + Then I should see the input field red + And I should see the password error message + + @javascript + Scenario: I see the password strength indicator with success + Given I visit profile password page + When I try to set a strong password + Then I should see the input field green
\ No newline at end of file diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index 7d3bea7878e..6d747b65bae 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -64,6 +64,24 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end end + step 'I try to set a weak password' do + within '.update-password' do + fill_in "user_password_profile", with: "22233344" + end + end + + step 'I try to set a short password' do + within '.update-password' do + fill_in "user_password_profile", with: "short" + end + end + + step 'I try to set a strong password' do + within '.update-password' do + fill_in "user_password_profile", with: "Itulvo9z8uud%$" + end + end + step 'I change my password' do within '.update-password' do fill_in "user_current_password", with: "12345678" @@ -86,6 +104,22 @@ class Spinach::Features::Profile < Spinach::FeatureSteps page.should have_content "You must provide a valid current password" end + step 'I should see the input field yellow' do + page.should have_css 'div.has-warning' + end + + step 'I should see the input field green' do + page.should have_css 'div.has-success' + end + + step 'I should see the input field red' do + page.should have_css 'div.has-error' + end + + step 'I should see the password error message' do + page.should have_content 'Your password is too short' + end + step "I should see a password error message" do page.should have_content "Password confirmation doesn't match" end |