nickname: sequence(:nickname, &"nick#{&1}"),
password_hash: Comeonin.Pbkdf2.hashpwsalt("test"),
bio: sequence(:bio, &"Tester Number #{&1}"),
- info: %{}
+ info: %{},
+ last_digest_emailed_at: NaiveDateTime.utc_now()
}
%{
user
| ap_id: User.ap_id(user),
follower_address: User.ap_followers(user),
+ following_address: User.ap_following(user),
following: [User.ap_id(user)]
}
end
user = attrs[:user] || insert(:user)
note = attrs[:note] || insert(:note, user: user)
- data = %{
- "id" => Pleroma.Web.ActivityPub.Utils.generate_activity_id(),
- "type" => "Create",
- "actor" => note.data["actor"],
- "to" => note.data["to"],
- "object" => note.data["id"],
- "published" => DateTime.utc_now() |> DateTime.to_iso8601(),
- "context" => note.data["context"]
- }
+ data_attrs = attrs[:data_attrs] || %{}
+ attrs = Map.drop(attrs, [:user, :note, :data_attrs])
+
+ data =
+ %{
+ "id" => Pleroma.Web.ActivityPub.Utils.generate_activity_id(),
+ "type" => "Create",
+ "actor" => note.data["actor"],
+ "to" => note.data["to"],
+ "object" => note.data["id"],
+ "published" => DateTime.utc_now() |> DateTime.to_iso8601(),
+ "context" => note.data["context"]
+ }
+ |> Map.merge(data_attrs)
%Pleroma.Activity{
data: data,
actor: data["actor"],
recipients: data["to"]
}
+ |> Map.merge(attrs)
end
def article_activity_factory do