Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit478ec10

Browse files
committed
chore: fix mock
1 parent39b6260 commit478ec10

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

‎test/support/factory.ex‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,26 @@ defmodule GroupherServer.Support.Factory do
299299
}
300300
end
301301

302+
defpmock_meta(:drink)do
303+
text=Faker.Lorem.sentence(%Range{first:80,last:120})
304+
305+
%{
306+
meta:@default_article_meta|>Map.merge(%{thread:"DRINK"}),
307+
title:String.slice(text,1,49),
308+
body:mock_rich_text(),
309+
digest:String.slice(text,1,150),
310+
# length: String.length(text),
311+
author:mock(:author),
312+
views:Enum.random(0..2000),
313+
original_community:mock(:community),
314+
communities:[
315+
mock(:community)
316+
],
317+
emotions:@default_emotions,
318+
active_at:Timex.shift(Timex.now(),seconds:+1)
319+
}
320+
end
321+
302322
defpmock_meta(:comment)do
303323
# text = Faker.Lorem.sentence(%Range{first: 30, last: 80})
304324

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp