}
end
- def note_factory do
+ def note_factory(attrs \\ %{}) do
text = sequence(:text, &"This is :moominmamma: note #{&1}")
user = insert(:user)
}
%Pleroma.Object{
- data: data
+ data: merge_attributes(data, Map.get(attrs, :data, %{}))
}
end
}
end
- def note_activity_factory do
- note = insert(:note)
+ def note_activity_factory(attrs \\ %{}) do
+ note = attrs[:note] || insert(:note)
data = %{
"id" => Pleroma.Web.ActivityPub.Utils.generate_activity_id(),
}
end
- def announce_activity_factory do
- note_activity = insert(:note_activity)
- user = insert(:user)
+ def announce_activity_factory(attrs \\ %{}) do
+ note_activity = attrs[:note_activity] || insert(:note_activity)
+ user = attrs[:user] || insert(:user)
data = %{
"type" => "Announce",
%Pleroma.Web.OAuth.App{
client_name: "Some client",
redirect_uris: "https://example.com/callback",
- scopes: ["read", "write", "follow"],
+ scopes: ["read", "write", "follow", "push"],
website: "https://example.com",
client_id: "aaabbb==",
client_secret: "aaa;/&bbb"