[#1335] Reorganized users.subscribers as UserRelationship. Added tests for UserRelationship-related functionality.
This commit is contained in:
parent
555edd01ab
commit
de892d2fe1
11 changed files with 263 additions and 62 deletions
|
|
@ -43,6 +43,18 @@ defmodule Pleroma.Factory do
|
|||
}
|
||||
end
|
||||
|
||||
def user_relationship_factory(attrs \\ %{}) do
|
||||
source = attrs[:source] || insert(:user)
|
||||
target = attrs[:target] || insert(:user)
|
||||
relationship_type = attrs[:relationship_type] || :block
|
||||
|
||||
%Pleroma.UserRelationship{
|
||||
source_id: source.id,
|
||||
target_id: target.id,
|
||||
relationship_type: relationship_type
|
||||
}
|
||||
end
|
||||
|
||||
def note_factory(attrs \\ %{}) do
|
||||
text = sequence(:text, &"This is :moominmamma: note #{&1}")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue