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
255a6817
Commit
255a6817
authored
Sep 17, 2017
by
lain
Browse files
TwitterAPI: Add tag timeline.
parent
b7b3e3f2
Changes
2
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/router.ex
View file @
255a6817
...
...
@@ -120,6 +120,7 @@ def user_fetcher(username) do
end
get
"/search"
,
TwitterAPI
.
Controller
,
:search
get
"/statusnet/tags/:tag"
,
TwitterAPI
.
Controller
,
:public_and_external_timeline
get
"/externalprofile/show"
,
TwitterAPI
.
Controller
,
:external_profile
end
...
...
test/web/twitter_api/twitter_api_controller_test.exs
View file @
255a6817
...
...
@@ -490,4 +490,20 @@ test "it returns search results", %{conn: conn} do
assert
status
[
"id"
]
==
activity
.
id
end
end
describe
"GET /api/statusnet/tags/timeline/:tag.json"
do
test
"it returns the tags timeline"
do
user
=
insert
(
:user
)
user_two
=
insert
(
:user
,
%{
nickname:
"shp@shitposter.club"
})
{
:ok
,
activity
}
=
CommonAPI
.
post
(
user
,
%{
"status"
=>
"This is about #2hu"
})
{
:ok
,
_
}
=
CommonAPI
.
post
(
user_two
,
%{
"status"
=>
"This isn't"
})
conn
=
conn
|>
get
(
"/api/statusnet/tags/2hu.json"
)
assert
[
status
]
=
json_response
(
conn
,
200
)
assert
status
[
"id"
]
==
activity
.
id
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