Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
7ebbe11e
Commit
7ebbe11e
authored
Feb 24, 2021
by
Alex Gleason
Committed by
lain
Mar 01, 2021
Browse files
user_agent_mock --> request_mock
parent
1dc5794e
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/pleroma/reverse_proxy_test.exs
View file @
7ebbe11e
...
...
@@ -18,7 +18,7 @@ defmodule Pleroma.ReverseProxyTest do
setup
:verify_on_exit!
defp
user_agen
t_mock
(
invokes
)
do
defp
reques
t_mock
(
invokes
)
do
ClientMock
|>
expect
(
:request
,
fn
:get
,
url
,
headers
,
_body
,
_opts
->
Registry
.
register
(
ClientMock
,
url
,
0
)
...
...
@@ -45,7 +45,7 @@ defp user_agent_mock(invokes) do
describe
"reverse proxy"
do
test
"do not track successful request"
,
%{
conn:
conn
}
do
user_agen
t_mock
(
2
)
reques
t_mock
(
2
)
url
=
"/success"
conn
=
ReverseProxy
.
call
(
conn
,
url
)
...
...
@@ -56,7 +56,7 @@ test "do not track successful request", %{conn: conn} do
end
test
"use Pleroma's user agent in the request; don't pass the client's"
,
%{
conn:
conn
}
do
user_agen
t_mock
(
2
)
reques
t_mock
(
2
)
conn
=
conn
...
...
@@ -110,7 +110,7 @@ defp stream_mock(invokes, with_close? \\ false) do
describe
"max_body"
do
test
"length returns error if content-length more than option"
,
%{
conn:
conn
}
do
user_agen
t_mock
(
0
)
reques
t_mock
(
0
)
assert
capture_log
(
fn
->
ReverseProxy
.
call
(
conn
,
"/huge-file"
,
max_body_length:
4
)
...
...
Write
Preview
Supports
Markdown
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