Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
feat(community): inc community contribute digest up to 30 days
Browse files Browse the repository at this point in the history
  • Loading branch information
mydearxym committed Jul 18, 2019
1 parent 45aa12e commit 0996698
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ config :groupher_server, :general,
page_size: 30,
inner_page_size: 5,
# today is not include
community_contribute_days: 7,
community_contribute_days: 30,
user_contribute_months: 6,
default_subscribed_communities: 20,
publish_throttle_interval_minutes: 3,
Expand Down
16 changes: 8 additions & 8 deletions test/groupher_server/statistics/statistics_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,23 @@ defmodule GroupherServer.Test.Statistics do
@tag :wip
test "should return recent #{@community_contribute_days} days community contributes by default",
~m(community)a do
seven_days_ago = Timex.shift(Timex.today(), days: -@community_contribute_days)
seven_more_days_ago = Timex.shift(seven_days_ago, days: -1)
days_ago = Timex.shift(Timex.today(), days: -@community_contribute_days)
more_days_ago = Timex.shift(days_ago, days: -1)

Repo.insert_all(CommunityContribute, [
%{
community_id: community.id,
date: seven_days_ago,
date: days_ago,
count: 1,
inserted_at: seven_days_ago |> Timex.to_datetime(),
updated_at: seven_days_ago |> Timex.to_datetime()
inserted_at: days_ago |> Timex.to_datetime(),
updated_at: days_ago |> Timex.to_datetime()
},
%{
community_id: community.id,
date: seven_more_days_ago,
date: more_days_ago,
count: 1,
inserted_at: seven_more_days_ago |> Timex.to_datetime(),
updated_at: seven_more_days_ago |> Timex.to_datetime()
inserted_at: more_days_ago |> Timex.to_datetime(),
updated_at: more_days_ago |> Timex.to_datetime()
}
])

Expand Down

0 comments on commit 0996698

Please sign in to comment.