atdis 0.3.9 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/atdis/models/page.rb +7 -3
- data/lib/atdis/version.rb +1 -1
- data/spec/atdis/models/page_spec.rb +9 -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: 38e9562a6501a1b60ea2a8b35b25acf01feed510
|
4
|
+
data.tar.gz: b84b2b417a0f7b64aaf5098b81889b1940cd3519
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0fe80b23658026ece106a52275eedc61a6257888d38b39ed78ab2247cece5b59cd121c0a18ede97f1d279905eef541602080802aea6d96dea2aefadfd08dc56a
|
7
|
+
data.tar.gz: 8135c87d36142106ebd2aa22995975daa421176e119d1f7201bfcbd9f410dfbd3161779704dffcb7ec68960fc08ac34b050999e52432ef33d453f88054d3c007
|
data/lib/atdis/models/page.rb
CHANGED
@@ -28,9 +28,13 @@ module ATDIS
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def count_is_consistent
|
31
|
-
if count
|
32
|
-
|
33
|
-
|
31
|
+
if count
|
32
|
+
if response.respond_to?(:count)
|
33
|
+
errors.add(:count, ErrorMessage["is not the same as the number of applications returned", "6.4"]) if count != response.count
|
34
|
+
end
|
35
|
+
if pagination.respond_to?(:per_page)
|
36
|
+
errors.add(:count, ErrorMessage["should not be larger than the number of results per page", "6.4"]) if count > pagination.per_page
|
37
|
+
end
|
34
38
|
end
|
35
39
|
end
|
36
40
|
|
data/lib/atdis/version.rb
CHANGED
@@ -33,6 +33,15 @@ describe ATDIS::Models::Page do
|
|
33
33
|
|
34
34
|
it {page.should be_valid}
|
35
35
|
|
36
|
+
# It's not super clear in the spec whether this should be allowed but it seems sensible to
|
37
|
+
# allow it.
|
38
|
+
context "with a count but no pagination" do
|
39
|
+
before :each do
|
40
|
+
page.count = 2
|
41
|
+
end
|
42
|
+
it { page.should be_valid }
|
43
|
+
end
|
44
|
+
|
36
45
|
context "with pagination" do
|
37
46
|
before :each do
|
38
47
|
page.count = 2
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: atdis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Landauer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|