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
8a0724ce
Commit
8a0724ce
authored
Sep 01, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `expect(subject)` rather than `is_expected`
parent
7addf910
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
spec/lib/gitlab/middleware/readonly_geo_spec.rb
spec/lib/gitlab/middleware/readonly_geo_spec.rb
+8
-8
No files found.
spec/lib/gitlab/middleware/readonly_geo_spec.rb
View file @
8a0724ce
...
...
@@ -49,21 +49,21 @@ describe Gitlab::Middleware::ReadonlyGeo do
response
=
request
.
patch
(
'/test_request'
)
expect
(
response
).
to
be_a_redirect
is_expected
.
to
disallow_request
expect
(
subject
)
.
to
disallow_request
end
it
'expects PUT requests to be disallowed'
do
response
=
request
.
put
(
'/test_request'
)
expect
(
response
).
to
be_a_redirect
is_expected
.
to
disallow_request
expect
(
subject
)
.
to
disallow_request
end
it
'expects POST requests to be disallowed'
do
response
=
request
.
post
(
'/test_request'
)
expect
(
response
).
to
be_a_redirect
is_expected
.
to
disallow_request
expect
(
subject
)
.
to
disallow_request
end
it
'expects a internal POST request to be allowed after a disallowed request'
do
...
...
@@ -80,7 +80,7 @@ describe Gitlab::Middleware::ReadonlyGeo do
response
=
request
.
delete
(
'/test_request'
)
expect
(
response
).
to
be_a_redirect
is_expected
.
to
disallow_request
expect
(
subject
)
.
to
disallow_request
end
context
'whitelisted requests'
do
...
...
@@ -88,28 +88,28 @@ describe Gitlab::Middleware::ReadonlyGeo do
response
=
request
.
delete
(
'/users/sign_out'
)
expect
(
response
).
not_to
be_a_redirect
is_expected
.
not_to
disallow_request
expect
(
subject
)
.
not_to
disallow_request
end
it
'expects a POST internal request to be allowed'
do
response
=
request
.
post
(
"/api/
#{
API
::
API
.
version
}
/internal"
)
expect
(
response
).
not_to
be_a_redirect
is_expected
.
not_to
disallow_request
expect
(
subject
)
.
not_to
disallow_request
end
it
'expects a GET status request to be allowed'
do
response
=
request
.
get
(
"/api/
#{
API
::
API
.
version
}
/geo/status"
)
expect
(
response
).
not_to
be_a_redirect
is_expected
.
not_to
disallow_request
expect
(
subject
)
.
not_to
disallow_request
end
it
'expects a POST LFS request to batch URL to be allowed'
do
response
=
request
.
post
(
'/root/rouge.git/info/lfs/objects/batch'
)
expect
(
response
).
not_to
be_a_redirect
is_expected
.
not_to
disallow_request
expect
(
subject
)
.
not_to
disallow_request
end
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