leaflet 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/leaflet/collection.rb +1 -3
- data/lib/leaflet/version.rb +1 -1
- data/spec/lib/leaflet/collection_spec.rb +8 -1
- metadata +2 -2
data/lib/leaflet/collection.rb
CHANGED
data/lib/leaflet/version.rb
CHANGED
@@ -33,6 +33,10 @@ describe Leaflet::Collection do
|
|
33
33
|
it 'corresponds to the records size' do
|
34
34
|
collection.total_entries.should == 5
|
35
35
|
end
|
36
|
+
|
37
|
+
it 'can be zero' do
|
38
|
+
Leaflet::Collection.new([]).total_entries.should == 0
|
39
|
+
end
|
36
40
|
end
|
37
41
|
|
38
42
|
describe '#total_count' do
|
@@ -73,6 +77,10 @@ describe Leaflet::Collection do
|
|
73
77
|
it 'is calculated from the passed in total' do
|
74
78
|
collection.total_pages.should == 10
|
75
79
|
end
|
80
|
+
|
81
|
+
it 'cannot be negative' do
|
82
|
+
Leaflet::Collection.new([], total: -5).total_entries.should == 5
|
83
|
+
end
|
76
84
|
end
|
77
85
|
|
78
86
|
describe '#per_page' do
|
@@ -93,5 +101,4 @@ describe Leaflet::Collection do
|
|
93
101
|
end
|
94
102
|
end
|
95
103
|
end
|
96
|
-
|
97
104
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leaflet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: positify
|