cloud_search 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -51,7 +51,7 @@ module CloudSearch
51
51
  end
52
52
 
53
53
  def at_page(page)
54
- @page_number = (page && page < 0) ? 1 : page
54
+ @page_number = (page && page < 1) ? 1 : page
55
55
  self
56
56
  end
57
57
 
@@ -1,3 +1,3 @@
1
1
  module CloudSearch
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -102,6 +102,14 @@ describe CloudSearch::Searcher do
102
102
  subject.at_page(2)
103
103
  subject.page_number.should == 2
104
104
  end
105
+
106
+ it "ensure page is greater than 1" do
107
+ subject.at_page(0)
108
+ subject.page_number.should == 1
109
+
110
+ subject.at_page(-1)
111
+ subject.page_number.should == 1
112
+ end
105
113
  end
106
114
 
107
115
  describe "#start" do
@@ -206,6 +214,7 @@ describe CloudSearch::Searcher do
206
214
  .should include "Star Wars: Episode II - Attack of the Clones"
207
215
  end
208
216
  end
217
+
209
218
  context "when paginate result" do
210
219
  before do
211
220
  subject
@@ -213,7 +222,6 @@ describe CloudSearch::Searcher do
213
222
  .with_query("star wars")
214
223
  end
215
224
 
216
-
217
225
  it "returns first page" do
218
226
  VCR.use_cassette "search/request/paginated_first_page" do
219
227
  subject.with_items_per_page(4)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloud_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: