Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
42ce2c10
Commit
42ce2c10
authored
Feb 21, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve selectors to pass capybara 2.0
parent
03f6a28e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
16 deletions
+21
-16
app/views/profiles/account.html.haml
app/views/profiles/account.html.haml
+2
-2
features/steps/profile/profile.rb
features/steps/profile/profile.rb
+14
-8
features/steps/shared/diff_note.rb
features/steps/shared/diff_note.rb
+3
-3
spec/spec_helper.rb
spec/spec_helper.rb
+2
-3
No files found.
app/views/profiles/account.html.haml
View file @
42ce2c10
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
%fieldset
%fieldset
.update-token
%legend
%legend
Private token
Private token
%span
.cred.pull-right
%span
.cred.pull-right
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
%span
You don`t have one yet. Click generate to fix it.
%span
You don`t have one yet. Click generate to fix it.
=
f
.
submit
'Generate'
,
class:
"btn success btn-build-token"
=
f
.
submit
'Generate'
,
class:
"btn success btn-build-token"
%fieldset
%fieldset
.update-password
%legend
Password
%legend
Password
=
form_for
@user
,
url:
update_password_profile_path
,
method: :put
do
|
f
|
=
form_for
@user
,
url:
update_password_profile_path
,
method: :put
do
|
f
|
.padded
.padded
...
...
features/steps/profile/profile.rb
View file @
42ce2c10
...
@@ -23,15 +23,19 @@ class Profile < Spinach::FeatureSteps
...
@@ -23,15 +23,19 @@ class Profile < Spinach::FeatureSteps
end
end
Then
'I change my password'
do
Then
'I change my password'
do
fill_in
"user_password"
,
:with
=>
"222333"
within
'.update-password'
do
fill_in
"user_password_confirmation"
,
:with
=>
"222333"
fill_in
"user_password"
,
:with
=>
"222333"
click_button
"Save"
fill_in
"user_password_confirmation"
,
:with
=>
"222333"
click_button
"Save"
end
end
end
When
'I unsuccessfully change my password'
do
When
'I unsuccessfully change my password'
do
fill_in
"user_password"
,
with:
"password"
within
'.update-password'
do
fill_in
"user_password_confirmation"
,
with:
"confirmation"
fill_in
"user_password"
,
with:
"password"
click_button
"Save"
fill_in
"user_password_confirmation"
,
with:
"confirmation"
click_button
"Save"
end
end
end
Then
"I should see a password error message"
do
Then
"I should see a password error message"
do
...
@@ -43,8 +47,10 @@ class Profile < Spinach::FeatureSteps
...
@@ -43,8 +47,10 @@ class Profile < Spinach::FeatureSteps
end
end
Then
'I reset my token'
do
Then
'I reset my token'
do
@old_token
=
@user
.
private_token
within
'.update-token'
do
click_button
"Reset"
@old_token
=
@user
.
private_token
click_button
"Reset"
end
end
end
And
'I should see new token'
do
And
'I should see new token'
do
...
...
features/steps/shared/diff_note.rb
View file @
42ce2c10
...
@@ -22,7 +22,7 @@ module SharedDiffNote
...
@@ -22,7 +22,7 @@ module SharedDiffNote
Given
'I leave a diff comment like "Typo, please fix"'
do
Given
'I leave a diff comment like "Typo, please fix"'
do
find
(
"#586fb7c4e1add2d4d24e27566ed7064680098646_29_14.line_holder .js-add-diff-note-button"
).
trigger
(
"click"
)
find
(
"#586fb7c4e1add2d4d24e27566ed7064680098646_29_14.line_holder .js-add-diff-note-button"
).
trigger
(
"click"
)
within
(
".file"
)
do
within
(
".file
form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_29_14']
"
)
do
fill_in
"note[note]"
,
with:
"Typo, please fix"
fill_in
"note[note]"
,
with:
"Typo, please fix"
#click_button("Add Comment")
#click_button("Add Comment")
find
(
".js-comment-button"
).
trigger
(
"click"
)
find
(
".js-comment-button"
).
trigger
(
"click"
)
...
@@ -32,7 +32,7 @@ module SharedDiffNote
...
@@ -32,7 +32,7 @@ module SharedDiffNote
Given
'I preview a diff comment text like "Should fix it :smile:"'
do
Given
'I preview a diff comment text like "Should fix it :smile:"'
do
find
(
"#586fb7c4e1add2d4d24e27566ed7064680098646_29_14.line_holder .js-add-diff-note-button"
).
trigger
(
"click"
)
find
(
"#586fb7c4e1add2d4d24e27566ed7064680098646_29_14.line_holder .js-add-diff-note-button"
).
trigger
(
"click"
)
within
(
".file"
)
do
within
(
".file
form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_29_14']
"
)
do
fill_in
"note[note]"
,
with:
"Should fix it :smile:"
fill_in
"note[note]"
,
with:
"Should fix it :smile:"
find
(
".js-note-preview-button"
).
trigger
(
"click"
)
find
(
".js-note-preview-button"
).
trigger
(
"click"
)
end
end
...
@@ -40,7 +40,7 @@ module SharedDiffNote
...
@@ -40,7 +40,7 @@ module SharedDiffNote
Given
'I preview another diff comment text like "DRY this up"'
do
Given
'I preview another diff comment text like "DRY this up"'
do
find
(
"#586fb7c4e1add2d4d24e27566ed7064680098646_57_41.line_holder .js-add-diff-note-button"
).
trigger
(
"click"
)
find
(
"#586fb7c4e1add2d4d24e27566ed7064680098646_57_41.line_holder .js-add-diff-note-button"
).
trigger
(
"click"
)
within
(
".file"
)
do
within
(
".file
form[rel$='586fb7c4e1add2d4d24e27566ed7064680098646_57_41']
"
)
do
fill_in
"note[note]"
,
with:
"DRY this up"
fill_in
"note[note]"
,
with:
"DRY this up"
find
(
".js-note-preview-button"
).
trigger
(
"click"
)
find
(
".js-note-preview-button"
).
trigger
(
"click"
)
end
end
...
...
spec/spec_helper.rb
View file @
42ce2c10
...
@@ -10,14 +10,13 @@ require 'capybara/rspec'
...
@@ -10,14 +10,13 @@ require 'capybara/rspec'
require
'webmock/rspec'
require
'webmock/rspec'
require
'email_spec'
require
'email_spec'
require
'sidekiq/testing/inline'
require
'sidekiq/testing/inline'
require
'capybara/poltergeist'
Capybara
.
javascript_driver
=
:poltergeist
# Requires supporting ruby files with custom matchers and macros, etc,
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
# in spec/support/ and its subdirectories.
Dir
[
Rails
.
root
.
join
(
"spec/support/**/*.rb"
)].
each
{
|
f
|
require
f
}
Dir
[
Rails
.
root
.
join
(
"spec/support/**/*.rb"
)].
each
{
|
f
|
require
f
}
require
'capybara/poltergeist'
Capybara
.
javascript_driver
=
:poltergeist
WebMock
.
disable_net_connect!
(
allow_localhost:
true
)
WebMock
.
disable_net_connect!
(
allow_localhost:
true
)
RSpec
.
configure
do
|
config
|
RSpec
.
configure
do
|
config
|
...
...
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