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
520bafe0
Commit
520bafe0
authored
Mar 23, 2021
by
Ryan Cobb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use request spec instead of controller
parent
be78ccd8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
spec/requests/customers_dot/proxy_controller_spec.rb
spec/requests/customers_dot/proxy_controller_spec.rb
+6
-6
No files found.
spec/
controller
s/customers_dot/proxy_controller_spec.rb
→
spec/
request
s/customers_dot/proxy_controller_spec.rb
View file @
520bafe0
...
...
@@ -2,24 +2,24 @@
require
'spec_helper'
RSpec
.
describe
CustomersDot
::
ProxyController
do
RSpec
.
describe
CustomersDot
::
ProxyController
,
type: :request
do
describe
'POST graphql'
do
let_it_be
(
:customers_dot
)
{
"
#{
Gitlab
::
SubscriptionPortal
::
SUBSCRIPTIONS_URL
}
/graphql"
}
it
'forwards request body to customers dot'
do
request_
body
=
'{ "foo" => "bar" }'
request_
params
=
'{ "foo" => "bar" }'
stub_request
(
:post
,
customers_dot
)
post
:graphql
,
body:
request_body
post
customers_dot_proxy_graphql_path
,
params:
request_params
expect
(
WebMock
).
to
have_requested
(
:post
,
customers_dot
).
with
(
body:
request_
body
)
expect
(
WebMock
).
to
have_requested
(
:post
,
customers_dot
).
with
(
body:
request_
params
)
end
it
'responds with customers dot status'
do
stub_request
(
:post
,
customers_dot
).
to_return
(
status:
500
)
post
:graphql
post
customers_dot_proxy_graphql_path
expect
(
response
).
to
have_gitlab_http_status
(
:internal_server_error
)
end
...
...
@@ -29,7 +29,7 @@ RSpec.describe CustomersDot::ProxyController do
stub_request
(
:post
,
customers_dot
).
to_return
(
body:
customers_dot_response
)
post
:graphql
post
customers_dot_proxy_graphql_path
expect
(
response
.
body
).
to
eq
(
customers_dot_response
)
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