Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eugenij
pleroma
Commits
5af91020
Verified
Commit
5af91020
authored
6 years ago
by
Haelwenn
Browse files
Options
Downloads
Patches
Plain Diff
Web.WebFinger.WebFingerControllerTest: test against XML and JRD webfinger endpoints
parent
ff7ce9a9
Branches
fix-streaming-reblog
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/web/web_finger/web_finger_controller_test.exs
+37
-0
37 additions, 0 deletions
test/web/web_finger/web_finger_controller_test.exs
with
37 additions
and
0 deletions
test/web/web_finger/web_finger_controller_test.exs
0 → 100644
+
37
−
0
View file @
5af91020
defmodule
Pleroma
.
Web
.
WebFinger
.
WebFingerControllerTest
do
use
Pleroma
.
Web
.
ConnCase
alias
Pleroma
.
User
alias
Pleroma
.
Web
.
WebFinger
.
WebFingerController
import
Pleroma
.
Factory
import
ExUnit
.
CaptureLog
import
Tesla
.
Mock
setup
do
mock
(
fn
env
->
apply
(
HttpRequestMock
,
:request
,
[
env
])
end
)
:ok
end
test
"Webfinger JRD"
do
user
=
insert
(
:user
)
response
=
build_conn
()
|>
put_req_header
(
"accept"
,
"application/jrd+json"
)
|>
get
(
"/.well-known/webfinger?resource=acct:
#{
user
.
nickname
}
@localhost"
)
assert
json_response
(
response
,
200
)[
"subject"
]
==
"acct:
#{
user
.
nickname
}
@localhost"
end
test
"Webfinger XML"
do
user
=
insert
(
:user
)
response
=
build_conn
()
|>
put_req_header
(
"accept"
,
"application/jrd+json"
)
|>
get
(
"/.well-known/webfinger?resource=acct:
#{
user
.
nickname
}
@localhost"
)
assert
response
(
response
,
200
)
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment