activity_feed 2.2.0 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.markdown +4 -0
- data/README.markdown +5 -0
- data/lib/activity_feed/feed.rb +4 -0
- data/lib/activity_feed/item.rb +6 -4
- data/lib/activity_feed/version.rb +1 -1
- data/spec/activity_feed/configuration_spec.rb +3 -3
- data/spec/activity_feed/feed_spec.rb +55 -50
- data/spec/activity_feed/item_spec.rb +19 -9
- data/spec/support/mongoid.rb +1 -2
- data/spec/version_spec.rb +1 -1
- metadata +4 -4
data/CHANGELOG.markdown
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 2.2.1 (2012-08-27)
|
4
|
+
|
5
|
+
* Added `total_pages` and `total_items` as aliases for `total_pages_in_feed` and `total_items_in_feed`, respectively.
|
6
|
+
|
3
7
|
## 2.2.0 (2012-08-20)
|
4
8
|
|
5
9
|
* Added `expire_feed(user_id, seconds, aggregate = ActivityFeed.aggregate)` and `expire_feed_at(user_id, timestamp, aggregate = ActivityFeed.aggregate)` methods to expire an activity feed after a given number of seconds or at a given time stamp, respectively.
|
data/README.markdown
CHANGED
@@ -282,6 +282,9 @@ feeds in which that activity feed item may have been aggregated.
|
|
282
282
|
# Item-related
|
283
283
|
|
284
284
|
ActivityFeed.update_item(user_id, item_id, timestamp, aggregate = ActivityFeed.aggregate)
|
285
|
+
ActivityFeed.add_item(user_id, item_id, timestamp, aggregate = ActivityFeed.aggregate)
|
286
|
+
# add_item is an alias for update_item
|
287
|
+
|
285
288
|
ActivityFeed.aggregate_item(user_id, item_id, timestamp)
|
286
289
|
ActivityFeed.remove_item(user_id, item_id)
|
287
290
|
|
@@ -291,7 +294,9 @@ ActivityFeed.feed(user_id, page, aggregate = ActivityFeed.aggregate)
|
|
291
294
|
ActivityFeed.full_feed(user_id, aggregate = ActivityFeed.aggregate)
|
292
295
|
ActivityFeed.feed_between_timestamps(user_id, starting_timestamp, ending_timestamp, aggregate = ActivityFeed.aggregate)
|
293
296
|
ActivityFeed.total_pages_in_feed(user_id, aggregate = ActivityFeed.aggregate, page_size = ActivityFeed.page_size)
|
297
|
+
ActivityFeed.total_pages(user_id, aggregate = ActivityFeed.aggregate, page_size = ActivityFeed.page_size)
|
294
298
|
ActivityFeed.total_items_in_feed(user_id, aggregate = ActivityFeed.aggregate)
|
299
|
+
ActivityFeed.total_items(user_id, aggregate = ActivityFeed.aggregate)
|
295
300
|
ActivityFeed.trim_feed(user_id, starting_timestamp, ending_timestamp, aggregate = ActivityFeed.aggregate)
|
296
301
|
ActivityFeed.expire_feed(user_id, seconds, aggregate = ActivityFeed.aggregate)
|
297
302
|
ActivityFeed.expire_feed_at(user_id, timestamp, aggregate = ActivityFeed.aggregate)
|
data/lib/activity_feed/feed.rb
CHANGED
@@ -90,6 +90,8 @@ module ActivityFeed
|
|
90
90
|
ActivityFeed.feederboard_for(user_id, aggregate).total_pages_in(ActivityFeed.feed_key(user_id, aggregate), page_size)
|
91
91
|
end
|
92
92
|
|
93
|
+
alias_method :total_pages, :total_pages_in_feed
|
94
|
+
|
93
95
|
# Return the total number of items in the activity feed.
|
94
96
|
#
|
95
97
|
# @param user_id [String] User ID.
|
@@ -100,6 +102,8 @@ module ActivityFeed
|
|
100
102
|
ActivityFeed.feederboard_for(user_id, aggregate).total_members
|
101
103
|
end
|
102
104
|
|
105
|
+
alias_method :total_items, :total_items_in_feed
|
106
|
+
|
103
107
|
# Remove the activity feeds for a given +user_id+.
|
104
108
|
#
|
105
109
|
# @param user_id [String] User ID.
|
data/lib/activity_feed/item.rb
CHANGED
@@ -16,8 +16,10 @@ module ActivityFeed
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
|
20
|
-
|
19
|
+
alias_method :add_item, :update_item
|
20
|
+
|
21
|
+
# Specifically aggregate an item in the activity feed for a given +user_id+.
|
22
|
+
# This is useful if you are going to background the process of populating
|
21
23
|
# a user's activity feed from friend's activities.
|
22
24
|
#
|
23
25
|
# @param user_id [String] User ID.
|
@@ -28,10 +30,10 @@ module ActivityFeed
|
|
28
30
|
feederboard.rank_member(item_id, timestamp)
|
29
31
|
end
|
30
32
|
|
31
|
-
# Remove an item from the activity feed for a given +user_id+. This
|
33
|
+
# Remove an item from the activity feed for a given +user_id+. This
|
32
34
|
# will also remove the item from the aggregate activity feed for the
|
33
35
|
# user.
|
34
|
-
#
|
36
|
+
#
|
35
37
|
# @param user_id [String] User ID.
|
36
38
|
# @param item_id [String] Item ID.
|
37
39
|
def remove_item(user_id, item_id)
|
@@ -4,10 +4,10 @@ describe ActivityFeed::Configuration do
|
|
4
4
|
describe '#configure' do
|
5
5
|
it 'should have default attributes' do
|
6
6
|
ActivityFeed.configure do |configuration|
|
7
|
-
configuration.namespace.should
|
7
|
+
configuration.namespace.should eql('activity_feed')
|
8
8
|
configuration.aggregate.should be_false
|
9
|
-
configuration.aggregate_key.should
|
10
|
-
configuration.page_size.should
|
9
|
+
configuration.aggregate_key.should eql('aggregate')
|
10
|
+
configuration.page_size.should eql(25)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -7,9 +7,9 @@ describe ActivityFeed::Feed do
|
|
7
7
|
add_items_to_feed('david')
|
8
8
|
|
9
9
|
feed = ActivityFeed.feed('david', 1)
|
10
|
-
feed.length.should
|
11
|
-
feed[0].to_i.should
|
12
|
-
feed[4].to_i.should
|
10
|
+
feed.length.should eql(5)
|
11
|
+
feed[0].to_i.should eql(5)
|
12
|
+
feed[4].to_i.should eql(1)
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -18,9 +18,9 @@ describe ActivityFeed::Feed do
|
|
18
18
|
add_items_to_feed('david', 5, true)
|
19
19
|
|
20
20
|
feed = ActivityFeed.feed('david', 1, true)
|
21
|
-
feed.length.should
|
22
|
-
feed[0].to_i.should
|
23
|
-
feed[4].to_i.should
|
21
|
+
feed.length.should eql(5)
|
22
|
+
feed[0].to_i.should eql(5)
|
23
|
+
feed[4].to_i.should eql(1)
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -31,9 +31,9 @@ describe ActivityFeed::Feed do
|
|
31
31
|
add_items_to_feed('david', 30)
|
32
32
|
|
33
33
|
feed = ActivityFeed.full_feed('david', false)
|
34
|
-
feed.length.should
|
35
|
-
feed[0].to_i.should
|
36
|
-
feed[29].to_i.should
|
34
|
+
feed.length.should eql(30)
|
35
|
+
feed[0].to_i.should eql(30)
|
36
|
+
feed[29].to_i.should eql(1)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
@@ -42,9 +42,9 @@ describe ActivityFeed::Feed do
|
|
42
42
|
add_items_to_feed('david', 30, true)
|
43
43
|
|
44
44
|
feed = ActivityFeed.full_feed('david', true)
|
45
|
-
feed.length.should
|
46
|
-
feed[0].to_i.should
|
47
|
-
feed[29].to_i.should
|
45
|
+
feed.length.should eql(30)
|
46
|
+
feed[0].to_i.should eql(30)
|
47
|
+
feed[29].to_i.should eql(1)
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
@@ -65,9 +65,9 @@ describe ActivityFeed::Feed do
|
|
65
65
|
Timecop.return
|
66
66
|
|
67
67
|
feed = ActivityFeed.feed_between_timestamps('david', Time.local(2012, 6, 19, 4, 43, 0).to_i, Time.local(2012, 6, 19, 8, 16, 0).to_i)
|
68
|
-
feed.length.should
|
69
|
-
feed[0].to_i.should
|
70
|
-
feed[1].to_i.should
|
68
|
+
feed.length.should eql(2)
|
69
|
+
feed[0].to_i.should eql(4)
|
70
|
+
feed[1].to_i.should eql(3)
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
@@ -86,19 +86,20 @@ describe ActivityFeed::Feed do
|
|
86
86
|
Timecop.return
|
87
87
|
|
88
88
|
feed = ActivityFeed.feed_between_timestamps('david', Time.local(2012, 6, 19, 4, 43, 0).to_i, Time.local(2012, 6, 19, 8, 16, 0).to_i, true)
|
89
|
-
feed.length.should
|
90
|
-
feed[0].to_i.should
|
91
|
-
feed[1].to_i.should
|
89
|
+
feed.length.should eql(2)
|
90
|
+
feed[0].to_i.should eql(4)
|
91
|
+
feed[1].to_i.should eql(3)
|
92
92
|
end
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
-
describe '#total_pages_in_feed' do
|
96
|
+
describe '#total_pages_in_feed and #total_pages' do
|
97
97
|
describe 'without aggregation' do
|
98
98
|
it 'should return the correct number of pages in the activity feed' do
|
99
99
|
add_items_to_feed('david', Leaderboard::DEFAULT_PAGE_SIZE + 1)
|
100
100
|
|
101
|
-
ActivityFeed.total_pages_in_feed('david').should
|
101
|
+
ActivityFeed.total_pages_in_feed('david').should eql(2)
|
102
|
+
ActivityFeed.total_pages('david').should eql(2)
|
102
103
|
end
|
103
104
|
end
|
104
105
|
|
@@ -106,7 +107,8 @@ describe ActivityFeed::Feed do
|
|
106
107
|
it 'should return the correct number of pages in the aggregate activity feed' do
|
107
108
|
add_items_to_feed('david', Leaderboard::DEFAULT_PAGE_SIZE + 1, true)
|
108
109
|
|
109
|
-
ActivityFeed.total_pages_in_feed('david', true).should
|
110
|
+
ActivityFeed.total_pages_in_feed('david', true).should eql(2)
|
111
|
+
ActivityFeed.total_pages('david', true).should eql(2)
|
110
112
|
end
|
111
113
|
end
|
112
114
|
|
@@ -114,7 +116,8 @@ describe ActivityFeed::Feed do
|
|
114
116
|
it 'should return the correct number of pages in the activity feed' do
|
115
117
|
add_items_to_feed('david', 25)
|
116
118
|
|
117
|
-
ActivityFeed.total_pages_in_feed('david', false, 4).should
|
119
|
+
ActivityFeed.total_pages_in_feed('david', false, 4).should eql(7)
|
120
|
+
ActivityFeed.total_pages('david', false, 4).should eql(7)
|
118
121
|
end
|
119
122
|
end
|
120
123
|
end
|
@@ -123,22 +126,23 @@ describe ActivityFeed::Feed do
|
|
123
126
|
it 'should remove the activity feeds for a given user ID' do
|
124
127
|
add_items_to_feed('david', Leaderboard::DEFAULT_PAGE_SIZE + 1, true)
|
125
128
|
|
126
|
-
ActivityFeed.total_items_in_feed('david').should
|
127
|
-
ActivityFeed.total_items_in_feed('david', true).should
|
129
|
+
ActivityFeed.total_items_in_feed('david').should eql(Leaderboard::DEFAULT_PAGE_SIZE + 1)
|
130
|
+
ActivityFeed.total_items_in_feed('david', true).should eql(Leaderboard::DEFAULT_PAGE_SIZE + 1)
|
128
131
|
|
129
132
|
ActivityFeed.remove_feeds('david')
|
130
133
|
|
131
|
-
ActivityFeed.total_items_in_feed('david').should
|
132
|
-
ActivityFeed.total_items_in_feed('david', true).should
|
134
|
+
ActivityFeed.total_items_in_feed('david').should eql(0)
|
135
|
+
ActivityFeed.total_items_in_feed('david', true).should eql(0)
|
133
136
|
end
|
134
137
|
end
|
135
138
|
|
136
|
-
describe '#total_items_in_feed' do
|
139
|
+
describe '#total_items_in_feed and #total_items' do
|
137
140
|
describe 'without aggregation' do
|
138
141
|
it 'should return the correct number of items in the activity feed' do
|
139
142
|
add_items_to_feed('david', Leaderboard::DEFAULT_PAGE_SIZE + 1)
|
140
143
|
|
141
|
-
ActivityFeed.total_items_in_feed('david').should
|
144
|
+
ActivityFeed.total_items_in_feed('david').should eql(Leaderboard::DEFAULT_PAGE_SIZE + 1)
|
145
|
+
ActivityFeed.total_items('david').should eql(Leaderboard::DEFAULT_PAGE_SIZE + 1)
|
142
146
|
end
|
143
147
|
end
|
144
148
|
|
@@ -146,7 +150,8 @@ describe ActivityFeed::Feed do
|
|
146
150
|
it 'should return the correct number of items in the aggregate activity feed' do
|
147
151
|
add_items_to_feed('david', Leaderboard::DEFAULT_PAGE_SIZE + 1, true)
|
148
152
|
|
149
|
-
ActivityFeed.total_items_in_feed('david', true).should
|
153
|
+
ActivityFeed.total_items_in_feed('david', true).should eql(Leaderboard::DEFAULT_PAGE_SIZE + 1)
|
154
|
+
ActivityFeed.total_items('david', true).should eql(Leaderboard::DEFAULT_PAGE_SIZE + 1)
|
150
155
|
end
|
151
156
|
end
|
152
157
|
end
|
@@ -154,45 +159,45 @@ describe ActivityFeed::Feed do
|
|
154
159
|
describe '#trim_feed' do
|
155
160
|
describe 'without aggregation' do
|
156
161
|
it 'should trim activity feed items between the starting and ending timestamps' do
|
157
|
-
|
162
|
+
Timecop.travel(Time.local(2012, 6, 19, 4, 0, 0))
|
158
163
|
ActivityFeed.update_item('david', 1, DateTime.now.to_i)
|
159
|
-
|
164
|
+
Timecop.travel(Time.local(2012, 6, 19, 4, 30, 0))
|
160
165
|
ActivityFeed.update_item('david', 2, DateTime.now.to_i)
|
161
|
-
|
166
|
+
Timecop.travel(Time.local(2012, 6, 19, 5, 30, 0))
|
162
167
|
ActivityFeed.update_item('david', 3, DateTime.now.to_i)
|
163
|
-
|
168
|
+
Timecop.travel(Time.local(2012, 6, 19, 6, 37, 0))
|
164
169
|
ActivityFeed.update_item('david', 4, DateTime.now.to_i)
|
165
|
-
|
170
|
+
Timecop.travel(Time.local(2012, 6, 19, 8, 17, 0))
|
166
171
|
ActivityFeed.update_item('david', 5, DateTime.now.to_i)
|
167
172
|
Timecop.return
|
168
173
|
|
169
174
|
ActivityFeed.trim_feed('david', Time.local(2012, 6, 19, 4, 29, 0).to_i, Time.local(2012, 6, 19, 8, 16, 0).to_i)
|
170
175
|
feed = ActivityFeed.feed('david', 1)
|
171
|
-
feed.length.should
|
172
|
-
feed[0].to_i.should
|
173
|
-
feed[1].to_i.should
|
176
|
+
feed.length.should eql(2)
|
177
|
+
feed[0].to_i.should eql(5)
|
178
|
+
feed[1].to_i.should eql(1)
|
174
179
|
end
|
175
180
|
end
|
176
181
|
|
177
182
|
describe 'with aggregation' do
|
178
183
|
it 'should trim activity feed items between the starting and ending timestamps' do
|
179
|
-
|
184
|
+
Timecop.travel(Time.local(2012, 6, 19, 4, 0, 0))
|
180
185
|
ActivityFeed.update_item('david', 1, DateTime.now.to_i, true)
|
181
|
-
|
186
|
+
Timecop.travel(Time.local(2012, 6, 19, 4, 30, 0))
|
182
187
|
ActivityFeed.update_item('david', 2, DateTime.now.to_i, true)
|
183
|
-
|
188
|
+
Timecop.travel(Time.local(2012, 6, 19, 5, 30, 0))
|
184
189
|
ActivityFeed.update_item('david', 3, DateTime.now.to_i, true)
|
185
|
-
|
190
|
+
Timecop.travel(Time.local(2012, 6, 19, 6, 37, 0))
|
186
191
|
ActivityFeed.update_item('david', 4, DateTime.now.to_i, true)
|
187
|
-
|
192
|
+
Timecop.travel(Time.local(2012, 6, 19, 8, 17, 0))
|
188
193
|
ActivityFeed.update_item('david', 5, DateTime.now.to_i, true)
|
189
194
|
Timecop.return
|
190
195
|
|
191
196
|
ActivityFeed.trim_feed('david', Time.local(2012, 6, 19, 4, 29, 0).to_i, Time.local(2012, 6, 19, 8, 16, 0).to_i, true)
|
192
197
|
feed = ActivityFeed.feed('david', 1, true)
|
193
|
-
feed.length.should
|
194
|
-
feed[0].to_i.should
|
195
|
-
feed[1].to_i.should
|
198
|
+
feed.length.should eql(2)
|
199
|
+
feed[0].to_i.should eql(5)
|
200
|
+
feed[1].to_i.should eql(1)
|
196
201
|
end
|
197
202
|
end
|
198
203
|
end
|
@@ -205,7 +210,7 @@ describe ActivityFeed::Feed do
|
|
205
210
|
end
|
206
211
|
|
207
212
|
feed = ActivityFeed.feed('david', 1)
|
208
|
-
feed.length.should
|
213
|
+
feed.length.should eql(0)
|
209
214
|
|
210
215
|
item = ActivityFeed::ActiveRecord::Item.create(
|
211
216
|
:user_id => 'david',
|
@@ -216,7 +221,7 @@ describe ActivityFeed::Feed do
|
|
216
221
|
)
|
217
222
|
|
218
223
|
feed = ActivityFeed.feed('david', 1)
|
219
|
-
feed.length.should
|
224
|
+
feed.length.should eql(1)
|
220
225
|
feed[0].should == item
|
221
226
|
end
|
222
227
|
end
|
@@ -226,7 +231,7 @@ describe ActivityFeed::Feed do
|
|
226
231
|
ActivityFeed.item_loader = Proc.new { |id| ActivityFeed::Mongoid::Item.find(id) }
|
227
232
|
|
228
233
|
feed = ActivityFeed.feed('david', 1)
|
229
|
-
feed.length.should
|
234
|
+
feed.length.should eql(0)
|
230
235
|
|
231
236
|
item = ActivityFeed::Mongoid::Item.create(
|
232
237
|
:user_id => 'david',
|
@@ -238,7 +243,7 @@ describe ActivityFeed::Feed do
|
|
238
243
|
)
|
239
244
|
|
240
245
|
feed = ActivityFeed.feed('david', 1)
|
241
|
-
feed.length.should
|
246
|
+
feed.length.should eql(1)
|
242
247
|
feed[0].should == item
|
243
248
|
end
|
244
249
|
end
|
@@ -248,7 +253,7 @@ describe ActivityFeed::Feed do
|
|
248
253
|
it 'should set an expiration on an activity feed' do
|
249
254
|
add_items_to_feed('david', Leaderboard::DEFAULT_PAGE_SIZE)
|
250
255
|
|
251
|
-
ActivityFeed.expire_feed('david', 10)
|
256
|
+
ActivityFeed.expire_feed('david', 10)
|
252
257
|
ActivityFeed.redis.ttl(ActivityFeed.feed_key('david')).tap do |ttl|
|
253
258
|
ttl.should be > 1
|
254
259
|
ttl.should be <= 10
|
@@ -22,6 +22,16 @@ describe ActivityFeed::Item do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
+
describe '#add_item' do
|
26
|
+
describe 'without aggregation' do
|
27
|
+
it 'should correctly build an activity feed' do
|
28
|
+
ActivityFeed.redis.exists(ActivityFeed.feed_key('david')).should be_false
|
29
|
+
ActivityFeed.add_item('david', 1, DateTime.now.to_i)
|
30
|
+
ActivityFeed.redis.exists(ActivityFeed.feed_key('david')).should be_true
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
25
35
|
describe '#aggregate_item' do
|
26
36
|
it 'should correctly add an item into an aggregate activity feed' do
|
27
37
|
ActivityFeed.redis.exists(ActivityFeed.feed_key('david')).should be_false
|
@@ -36,12 +46,12 @@ describe ActivityFeed::Item do
|
|
36
46
|
describe 'without aggregation' do
|
37
47
|
it 'should remove an item from an activity feed' do
|
38
48
|
ActivityFeed.redis.exists(ActivityFeed.feed_key('david')).should be_false
|
39
|
-
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david')).should
|
49
|
+
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david')).should eql(0)
|
40
50
|
ActivityFeed.update_item('david', 1, DateTime.now.to_i)
|
41
51
|
ActivityFeed.redis.exists(ActivityFeed.feed_key('david')).should be_true
|
42
|
-
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david')).should
|
52
|
+
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david')).should eql(1)
|
43
53
|
ActivityFeed.remove_item('david', 1)
|
44
|
-
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david')).should
|
54
|
+
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david')).should eql(0)
|
45
55
|
end
|
46
56
|
end
|
47
57
|
|
@@ -49,16 +59,16 @@ describe ActivityFeed::Item do
|
|
49
59
|
it 'should remove an item from an activity feed and the aggregate feed' do
|
50
60
|
ActivityFeed.redis.exists(ActivityFeed.feed_key('david')).should be_false
|
51
61
|
ActivityFeed.redis.exists(ActivityFeed.feed_key('david', true)).should be_false
|
52
|
-
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david')).should
|
53
|
-
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david', true)).should
|
62
|
+
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david')).should eql(0)
|
63
|
+
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david', true)).should eql(0)
|
54
64
|
ActivityFeed.update_item('david', 1, DateTime.now.to_i, true)
|
55
65
|
ActivityFeed.redis.exists(ActivityFeed.feed_key('david')).should be_true
|
56
66
|
ActivityFeed.redis.exists(ActivityFeed.feed_key('david', true)).should be_true
|
57
|
-
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david')).should
|
58
|
-
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david', true)).should
|
67
|
+
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david')).should eql(1)
|
68
|
+
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david', true)).should eql(1)
|
59
69
|
ActivityFeed.remove_item('david', 1)
|
60
|
-
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david')).should
|
61
|
-
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david', true)).should
|
70
|
+
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david')).should eql(0)
|
71
|
+
ActivityFeed.redis.zcard(ActivityFeed.feed_key('david', true)).should eql(0)
|
62
72
|
end
|
63
73
|
end
|
64
74
|
end
|
data/spec/support/mongoid.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'spec_helper'
|
2
1
|
require 'mongoid'
|
3
2
|
|
4
3
|
Mongoid.configure do |config|
|
@@ -10,7 +9,7 @@ DatabaseCleaner[:mongoid].strategy = :truncation
|
|
10
9
|
module ActivityFeed
|
11
10
|
module Mongoid
|
12
11
|
class Item
|
13
|
-
include ::Mongoid::Document
|
12
|
+
include ::Mongoid::Document
|
14
13
|
include ::Mongoid::Timestamps
|
15
14
|
|
16
15
|
field :user_id, :type => String
|
data/spec/version_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activity_feed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
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: 2012-
|
12
|
+
date: 2012-09-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -215,7 +215,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
215
|
version: '0'
|
216
216
|
segments:
|
217
217
|
- 0
|
218
|
-
hash: -
|
218
|
+
hash: -3848997138192536076
|
219
219
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
220
|
none: false
|
221
221
|
requirements:
|
@@ -224,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
224
|
version: '0'
|
225
225
|
segments:
|
226
226
|
- 0
|
227
|
-
hash: -
|
227
|
+
hash: -3848997138192536076
|
228
228
|
requirements: []
|
229
229
|
rubyforge_project: activity_feed
|
230
230
|
rubygems_version: 1.8.24
|