BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
000af8d5
Commit
000af8d5
authored
Oct 24, 2014
by
Patricio Cano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved require from application.js to password_strength.js
Corrected div id for profile password/edit Added first spinach tests
parent
7fbc4f5b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
2 deletions
+56
-2
application.js.coffee
app/assets/javascripts/application.js.coffee
+0
-1
password_strength.js.coffee
app/assets/javascripts/password_strength.js.coffee
+1
-0
edit.html.haml
app/views/profiles/passwords/edit.html.haml
+1
-1
profile.feature
features/profile/profile.feature
+20
-0
profile.rb
features/steps/profile/profile.rb
+34
-0
No files found.
app/assets/javascripts/application.js.coffee
View file @
000af8d5
...
...
@@ -18,7 +18,6 @@
#= require jquery.turbolinks
#= require turbolinks
#= require bootstrap
#= require pwstrength-bootstrap-1.2.2
#= require password_strength
#= require select2
#= require raphael
...
...
app/assets/javascripts/password_strength.js.coffee
View file @
000af8d5
#= require pwstrength-bootstrap-1.2.2
overwritten_messages
=
wordSimilarToUsername
:
"Your password should not contain your username"
...
...
app/views/profiles/passwords/edit.html.haml
View file @
000af8d5
...
...
@@ -21,7 +21,7 @@
%div
=
link_to
"Forgot your password?"
,
reset_profile_password_path
,
method: :put
.form-group
#password-strength
.form-group
=
f
.
label
:password
,
'New password'
,
class:
'control-label'
.col-sm-10
=
f
.
password_field
:password
,
required:
true
,
class:
'form-control'
,
id:
'user_password_profile'
...
...
features/profile/profile.feature
View file @
000af8d5
...
...
@@ -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
features/steps/profile/profile.rb
View file @
000af8d5
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment