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
Jérome Perrin
gitlab-ce
Commits
0364e074
Commit
0364e074
authored
Nov 02, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address Douwe's feedback
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
1c17ddba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
+12
-3
doc/development/testing_guide/best_practices.md
doc/development/testing_guide/best_practices.md
+1
-1
spec/support/live_debugger.rb
spec/support/live_debugger.rb
+3
-2
spec/support/login_helpers.rb
spec/support/login_helpers.rb
+8
-0
No files found.
doc/development/testing_guide/best_practices.md
View file @
0364e074
...
@@ -72,7 +72,7 @@ To resume the test run, press any key.
...
@@ -72,7 +72,7 @@ To resume the test run, press any key.
For example:
For example:
```
ruby
```
$ bin/rspec spec/features/auto_deploy_spec.rb:34
$ bin/rspec spec/features/auto_deploy_spec.rb:34
Running via Spring preloader in process 8999
Running via Spring preloader in process 8999
Run options: include {:locations=>{"./spec/features/auto_deploy_spec.rb"=>[34]}}
Run options: include {:locations=>{"./spec/features/auto_deploy_spec.rb"=>[34]}}
...
...
spec/support/live_debugger.rb
View file @
0364e074
...
@@ -2,9 +2,10 @@ require 'io/console'
...
@@ -2,9 +2,10 @@ require 'io/console'
module
LiveDebugger
module
LiveDebugger
def
live_debug
def
live_debug
puts
"
\n
Current example is paused for live debugging."
puts
puts
"Current example is paused for live debugging."
puts
"Opening
#{
current_url
}
in your default browser..."
puts
"Opening
#{
current_url
}
in your default browser..."
puts
"The current user credentials are:
#{
@current_user
.
username
}
/
12345678
"
if
@current_user
puts
"The current user credentials are:
#{
@current_user
.
username
}
/
#{
@current_user
.
password
}
"
if
@current_user
puts
"Press any key to resume the execution of the example!!"
puts
"Press any key to resume the execution of the example!!"
`open
#{
current_url
}
`
`open
#{
current_url
}
`
...
...
spec/support/login_helpers.rb
View file @
0364e074
...
@@ -11,6 +11,13 @@ module LoginHelpers
...
@@ -11,6 +11,13 @@ module LoginHelpers
@current_user
=
resource
@current_user
=
resource
end
end
# Overriding Devise::Test::IntegrationHelpers#sign_out to clear @current_user.
def
sign_out
(
resource_or_scope
)
super
@current_user
=
nil
end
# Internal: Log in as a specific user or a new user of a specific role
# Internal: Log in as a specific user or a new user of a specific role
#
#
# user_or_role - User object, or a role to create (e.g., :admin, :user)
# user_or_role - User object, or a role to create (e.g., :admin, :user)
...
@@ -49,6 +56,7 @@ module LoginHelpers
...
@@ -49,6 +56,7 @@ module LoginHelpers
def
gitlab_sign_out
def
gitlab_sign_out
find
(
".header-user-dropdown-toggle"
).
click
find
(
".header-user-dropdown-toggle"
).
click
click_link
"Sign out"
click_link
"Sign out"
@current_user
=
nil
expect
(
page
).
to
have_button
(
'Sign in'
)
expect
(
page
).
to
have_button
(
'Sign in'
)
end
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