c2 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,7 +38,7 @@ class C2::Informant::Locus
38
38
  end
39
39
 
40
40
  def entries_page(page=1,per=10)
41
- entries_as_json(entries.offset((page - 1) * per).limit(per))
41
+ entries_as_json(entries)
42
42
  end
43
43
 
44
44
  def entry_as_json(entry)
@@ -31,5 +31,19 @@ describe C2::Informant::Locus do
31
31
  label.should be_nil
32
32
  end
33
33
  end
34
+
35
+ describe '#entries_page' do
36
+ before(:all) do
37
+ 20.times {|| Fabricate(:user) }
38
+ end
39
+
40
+ it 'should return all entries' do
41
+ locus.entries_page.size.should == 21
42
+ Fabricate(:user)
43
+ locus.entries_page.size.should == 22
44
+ locus.entries.last.destroy
45
+ locus.entries_page.size.should == 21
46
+ end
47
+ end
34
48
 
35
49
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: c2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 5
10
- version: 0.1.5
9
+ - 6
10
+ version: 0.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - hexorx
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-26 00:00:00 -06:00
18
+ date: 2011-04-27 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency