Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pleroma
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
384
Issues
384
List
Boards
Labels
Service Desk
Milestones
Merge Requests
56
Merge Requests
56
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pleroma
pleroma
Commits
9694d514
Commit
9694d514
authored
Oct 14, 2019
by
Maksim
Committed by
kaniini
Oct 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test fo Pleroma.Web.MastodonAPI.StatusController
parent
80d3912a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
test/web/mastodon_api/controllers/status_controller_test.exs
test/web/mastodon_api/controllers/status_controller_test.exs
+29
-0
No files found.
test/web/mastodon_api/controllers/status_controller_test.exs
View file @
9694d514
...
...
@@ -12,6 +12,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
alias
Pleroma
.
Object
alias
Pleroma
.
Repo
alias
Pleroma
.
ScheduledActivity
alias
Pleroma
.
Tests
.
ObanHelpers
alias
Pleroma
.
User
alias
Pleroma
.
Web
.
ActivityPub
.
ActivityPub
alias
Pleroma
.
Web
.
CommonAPI
...
...
@@ -29,6 +30,34 @@ defmodule Pleroma.Web.MastodonAPI.StatusControllerTest do
[
conn:
conn
]
end
test
"posting a status and checks reblog count after perform all backroud job"
,
%{
conn:
conn
}
do
Pleroma
.
Config
.
put
([
:instance
,
:federating
],
true
)
Pleroma
.
Config
.
get
([
:instance
,
:allow_relay
],
true
)
user
=
insert
(
:user
)
response
=
conn
|>
assign
(
:user
,
user
)
|>
post
(
"api/v1/statuses"
,
%{
"content_type"
=>
"text/plain"
,
"source"
=>
"Pleroma FE"
,
"status"
=>
"Hello world"
,
"visibility"
=>
"public"
})
|>
json_response
(
200
)
assert
response
[
"reblogs_count"
]
==
0
ObanHelpers
.
perform_all
()
response
=
conn
|>
assign
(
:user
,
user
)
|>
get
(
"api/v1/statuses/
#{
response
[
"id"
]
}
"
,
%{})
|>
json_response
(
200
)
assert
response
[
"reblogs_count"
]
==
0
end
test
"posting a status"
,
%{
conn:
conn
}
do
idempotency_key
=
"Pikachu rocks!"
...
...
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