Commit ed9374c5754bc86636cd0f09f0aabde7df6d5ef2

Authored by Andrew Kane
1 parent 6f017b61

Added out_of_range? test

Showing 2 changed files with 2 additions and 3 deletions   Show diff stats
lib/searchkick/results.rb
... ... @@ -132,11 +132,9 @@ module Searchkick
132 132 end
133 133  
134 134 def out_of_range?
135   - options[:page] > (total_count / per_page.to_f).ceil
  135 + current_page > total_pages
136 136 end
137 137  
138   - protected
139   -
140 138 def hits
141 139 @response["hits"]["hits"]
142 140 end
... ...
test/sql_test.rb
... ... @@ -40,6 +40,7 @@ class TestSql < Minitest::Test
40 40 assert !products.first_page?
41 41 assert !products.last_page?
42 42 assert !products.empty?
  43 + assert !products.out_of_range?
43 44 assert products.any?
44 45 end
45 46  
... ...