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
be78ccd8
Commit
be78ccd8
authored
Mar 22, 2021
by
Ryan Cobb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for customers_dot proxy
parent
0d3d532d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
app/controllers/customers_dot/proxy_controller.rb
app/controllers/customers_dot/proxy_controller.rb
+2
-0
spec/controllers/customers_dot/proxy_controller_spec.rb
spec/controllers/customers_dot/proxy_controller_spec.rb
+37
-0
No files found.
app/controllers/customers_dot/proxy_controller.rb
View file @
be78ccd8
...
...
@@ -5,6 +5,8 @@ module CustomersDot
skip_before_action
:authenticate_user!
skip_before_action
:verify_authenticity_token
feature_category
:purchase
BASE_URL
=
Gitlab
::
SubscriptionPortal
::
SUBSCRIPTIONS_URL
def
graphql
...
...
spec/controllers/customers_dot/proxy_controller_spec.rb
0 → 100644
View file @
be78ccd8
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
CustomersDot
::
ProxyController
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" }'
stub_request
(
:post
,
customers_dot
)
post
:graphql
,
body:
request_body
expect
(
WebMock
).
to
have_requested
(
:post
,
customers_dot
).
with
(
body:
request_body
)
end
it
'responds with customers dot status'
do
stub_request
(
:post
,
customers_dot
).
to_return
(
status:
500
)
post
:graphql
expect
(
response
).
to
have_gitlab_http_status
(
:internal_server_error
)
end
it
'responds with customers dot response body'
do
customers_dot_response
=
'foo'
stub_request
(
:post
,
customers_dot
).
to_return
(
body:
customers_dot_response
)
post
:graphql
expect
(
response
.
body
).
to
eq
(
customers_dot_response
)
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