Skip to content
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 search failing test #1213

Merged
merged 1 commit into from
Oct 7, 2023
Merged

Commits on Oct 5, 2023

  1. Fix search failing test

    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,
    specially 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 method
    https://github.com/JuanVqz/lobsters/blob/5338e5a4b335b94337636a59b7bbc83529dfce81/app/controllers/search_controller.rb#L30
    
    It takes the -1 value by default which in this if/else statement
    
    https://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 the Search hints:
    
    if that is the decired behaviour then this PR is solving it.
    JuanVqz committed Oct 5, 2023
    Configuration menu
    Copy the full SHA
    c060132 View commit details
    Browse the repository at this point in the history