-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix query_string issue and range search issue #269
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #269 +/- ##
=========================================
Coverage 96.08% 96.08%
- Complexity 193 194 +1
=========================================
Files 36 36
Lines 638 639 +1
=========================================
+ Hits 613 614 +1
Misses 25 25 ☔ View full report in Codecov by Sentry. |
Hello @Fayne, thank you for your contribution and solution. Could you please provide us with a test for that bit? |
Ideally if you'll add a test that fails to another branch |
tests/Feature/SearchTest.php
Outdated
RangeQuery::GTE => 900, | ||
]))->get(); | ||
|
||
$this->assertEquals($expensiveProducts->count(), $greaterCount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertEquals( mixed $expected, mixed $actual, string $message = '' )
should be
$this->assertEquals($greaterCount, $expensiveProducts->count());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for incorrect order. Fixed it. Please review.
@Fayne Thank you for your contribution with the unit testing. I appreciate your effort to help improve the project. However, it seems there has been a slight misunderstanding regarding the test you added. Request was to create correct test(it should search between 200 and 300) but in a branch without your solution. So the test should fail. Then we merge the test to branch with yours solution and it should pass. It's RED GREEN test approach for tests https://www.codecademy.com/article/tdd-red-green-refactor Anyway I think we are safe, so feel free just to fix the test and we can merge |
Hi @matchish , I updated the unit testing function. Wish this time i didn't make the stupid mistake as last time. 😂 |
Hi @matchish I added 3 assertions and it's working fine on my side. Could you please review it? Thanks. |
…ty() function instead of is_null() function to check user passes a query string or not. For unit testing issue, we have result too big issue, now i'm using paginate method to replace get() method.
It's ready for release)
|
Hi @matchish, I updated the readme and changelog. Please review. |
When i call like this
search body will be:
This is not what i want. Please check if the PR work for you.