Commit 38602fa9 authored by Ben Hayward's avatar Ben Hayward

more feedback

1 merge request!251[Sprint/InterestingIguana](feat): Offchain boost rate limiting #475
Pipeline #74210451 failed with stages
in 4 minutes and 35 seconds
......@@ -72,7 +72,7 @@ class ElasticRepository
$must[] = [
'term' => [
'owner_guid' => $opts['owner_guid'],
]
],
];
}
......@@ -94,8 +94,8 @@ class ElasticRepository
if ($opts['offchain']) {
$must[] = [
'term' => [
'token_method' => 'offchain'
]
'token_method' => 'offchain',
],
];
}
......
......@@ -65,4 +65,5 @@ class ElasticRepositorySpec extends ObjectBehavior
$this->add($boost)
->shouldReturn(true);
}
}
......@@ -273,12 +273,12 @@ class ManagerSpec extends ObjectBehavior
function it_should_check_if_the_entity_was_already_boosted(Boost $boost)
{
$this->elasticRepository->getList([
"hydrate" => true,
"useElastic" => true,
"state" => "review",
"type" => "newsfeed",
"entity_guid" => "123",
"limit" => 1
'hydrate' => true,
'useElastic' => true,
'state' => 'review',
'type' => 'newsfeed',
'entity_guid' => '123',
'limit' => 1
])
->shouldBeCalled()
->willReturn(new Response([$boost], ''));
......@@ -300,7 +300,16 @@ class ManagerSpec extends ObjectBehavior
function it_should_request_offchain_boosts(Boost $boost)
{
$this->elasticRepository->getList(["hydrate" => true, "useElastic" => true, "state" => "review", "type" => "newsfeed", "limit" => 10, "order" => "desc", "offchain" => true, "owner_guid" => "123"])
$this->elasticRepository->getList([
"hydrate" => true,
"useElastic" => true,
"state" => "review",
"type" => "newsfeed",
"limit" => 10,
"order" => "desc",
"offchain" => true,
"owner_guid" => "123"
])
->shouldBeCalled()
->willReturn(new Response([$boost], ''));
......@@ -363,7 +372,16 @@ class ManagerSpec extends ObjectBehavior
}
function runThroughGetList($boost, $existingBoosts) {
$this->elasticRepository->getList(["hydrate" => true, "useElastic" => true, "state" => "review", "type" => "newsfeed", "limit" => 10, "order" => "desc", "offchain" => true, "owner_guid" => "123"])
$this->elasticRepository->getList([
"hydrate" => true,
"useElastic" => true,
"state" => "review",
"type" => "newsfeed",
"limit" => 10,
"order" => "desc",
"offchain" => true,
"owner_guid" => "123"
])
->shouldBeCalled()
->willReturn(new Response($existingBoosts, ''));
......
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