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
834c84b5
Commit
834c84b5
authored
Apr 13, 2017
by
lain
Browse files
Update factory.
parent
653d605e
Changes
1
Show whitespace changes
Inline
Side-by-side
test/support/factory.ex
View file @
834c84b5
...
@@ -34,6 +34,7 @@ def note_activity_factory do
...
@@ -34,6 +34,7 @@ def note_activity_factory do
note
=
insert
(
:note
)
note
=
insert
(
:note
)
data
=
%{
data
=
%{
"id"
=>
Pleroma
.
Web
.
ActivityPub
.
ActivityPub
.
generate_activity_id
,
"id"
=>
Pleroma
.
Web
.
ActivityPub
.
ActivityPub
.
generate_activity_id
,
"type"
=>
"Create"
,
"actor"
=>
note
.
data
[
"actor"
],
"actor"
=>
note
.
data
[
"actor"
],
"to"
=>
note
.
data
[
"to"
],
"to"
=>
note
.
data
[
"to"
],
"object"
=>
note
.
data
,
"object"
=>
note
.
data
,
...
@@ -44,4 +45,21 @@ def note_activity_factory do
...
@@ -44,4 +45,21 @@ def note_activity_factory do
data:
data
data:
data
}
}
end
end
def
like_activity_factory
do
note_activity
=
insert
(
:note_activity
)
user
=
insert
(
:user
)
data
=
%{
"id"
=>
Pleroma
.
Web
.
ActivityPub
.
ActivityPub
.
generate_activity_id
,
"actor"
=>
user
.
ap_id
,
"type"
=>
"Like"
,
"object"
=>
note_activity
.
data
[
"object"
][
"id"
],
"published_at"
=>
DateTime
.
utc_now
()
|>
DateTime
.
to_iso8601
}
%
Pleroma
.
Activity
{
data:
data
}
end
end
end
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