Commit 8145dad9 authored by Mark Harding's avatar Mark Harding

(fix): supply metric

1 merge request!236epic/referrals
Pipeline #71662440 passed with stages
in 6 minutes and 57 seconds
......@@ -50,7 +50,9 @@ class ReferralDelegate
{
$ts = strtotime('midnight');
$contribution = new Contribution();
$contribution->setTimestamp($ts)
$contribution
->setMetric('referrals_welcome')
->setTimestamp($ts)
->setUser($user)
->setScore(ContributionValues::$multipliers['referrals_welcome'])
->setAmount(1);
......
......@@ -59,7 +59,8 @@ class ReferralDelegateSpec extends ObjectBehavior
->shouldBeCalled();
$this->contributionsManager->add(Argument::that(function($contribution) {
return $contribution->getScore() === 50
return $contribution->getMetric() === 'referrals_welcome'
&& $contribution->getScore() === 50
&& $contribution->getAmount() === 1
&& $contribution->getUser()->guid === 456
&& $contribution->getTimestamp() === strtotime('midnight');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment