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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
a65e5d04
Commit
a65e5d04
authored
Jan 09, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly disable WebMock and fix spec
Closes #4528
parent
738b63c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
features/steps/group_hooks.rb
features/steps/group_hooks.rb
+1
-3
features/support/env.rb
features/support/env.rb
+2
-1
No files found.
features/steps/group_hooks.rb
View file @
a65e5d04
...
...
@@ -41,14 +41,12 @@ class Spinach::Features::GroupHooks < Spinach::FeatureSteps
end
step
'I click test hook button'
do
WebMock
.
enable!
stub_request
(
:post
,
@hook
.
url
).
to_return
(
status:
200
)
click_link
'Test'
WebMock
.
disable!
end
step
'I click test hook button with invalid URL'
do
stub_request
(
:post
,
@hook
.
url
).
to_raise
(
SocketError
)
stub_request
(
:post
,
@hook
.
url
).
to_raise
(
SocketError
.
new
(
'Failed to open'
)
)
click_link
'Test'
end
...
...
features/support/env.rb
View file @
a65e5d04
...
...
@@ -21,7 +21,8 @@ end
Dir
[
"
#{
Rails
.
root
}
/features/steps/shared/*.rb"
].
each
{
|
file
|
require
file
}
WebMock
.
allow_net_connect!
WebMock
.
enable!
WebMock
.
disable_net_connect!
(
allow_localhost:
true
)
Spinach
.
hooks
.
before_run
do
include
RSpec
::
Mocks
::
ExampleMethods
...
...
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