clean_pagination 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/clean_pagination/version.rb +1 -1
- data/lib/clean_pagination.rb +1 -1
- data/test/clean_pagination_test.rb +10 -0
- data/test/dummy/log/test.log +2619 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc83a0b2f1b894df997f13f0599230edb5e935cf
|
4
|
+
data.tar.gz: 4dad8369da2b93279d30a0d0fc09bbfd4c582ae2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b62c0ad0ad9783f727c0d95d5f70ef7b76e3996289644930b3da08378739c9ae85ba02a3044cbac28424d484a07c461245f961fabb1eedd622e9b951d34aec14
|
7
|
+
data.tar.gz: 82321d852b9e6ea89fbafa02f85cd12415ad3e565359b6632526572125ac0498f7a78aeebabde92357de0615c86131a3b681bddfdf9912a1d1297e0038a7f400
|
data/lib/clean_pagination.rb
CHANGED
@@ -93,6 +93,16 @@ class ApplicationControllerTest < ActionController::TestCase
|
|
93
93
|
assert_equal '*/101', response.headers['Content-Range']
|
94
94
|
end
|
95
95
|
|
96
|
+
test "allows one-item requests" do
|
97
|
+
@request.headers['Range-Unit'] = 'items'
|
98
|
+
@request.headers['Range'] = "0-0"
|
99
|
+
|
100
|
+
@controller.expects(:action).with(1, 0)
|
101
|
+
get :index
|
102
|
+
assert_equal 206, response.status
|
103
|
+
assert_equal '0-0/101', response.headers['Content-Range']
|
104
|
+
end
|
105
|
+
|
96
106
|
test "handles ranges beyond collection length via truncation" do
|
97
107
|
@request.headers['Range-Unit'] = 'items'
|
98
108
|
@request.headers['Range'] = "50-200"
|