Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is just for fixing the latest merge that introduces a failing
test.
When initializing a new Search model it has some default values,
especially the
results_count
one.https://github.com/JuanVqz/lobsters/blob/5338e5a4b335b94337636a59b7bbc83529dfce81/app/models/search.rb#L42
When doing Search.new({}, nil) in the
ignore_searx
methodhttps://github.com/JuanVqz/lobsters/blob/5338e5a4b335b94337636a59b7bbc83529dfce81/app/controllers/search_controller.rb#L30
It takes the
-1
value by default which in this if/else statementhttps://github.com/JuanVqz/lobsters/blob/5338e5a4b335b94337636a59b7bbc83529dfce81/app/views/search/index.html.erb#L40
is rendering this else block
https://github.com/JuanVqz/lobsters/blob/5338e5a4b335b94337636a59b7bbc83529dfce81/app/views/search/index.html.erb#L157-L167
and that doesn't render the
0 results
but it renders theSearch hints:
if that is the required behaviour then this PR is solving it.
otherwise, let me know and I'll arrange it as desired.