muck-activities 0.1.19 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +5 -0
- data/VERSION +1 -1
- data/app/controllers/muck/activities_controller.rb +2 -2
- data/app/helpers/muck_activity_helper.rb +38 -13
- data/app/views/activities/_activity_feed.html.erb +2 -6
- data/app/views/activities/_activity_scripts.html.erb +5 -0
- data/app/views/activities/_cached_activities.html.erb +2 -3
- data/app/views/activities/_contribute.html.erb +22 -0
- data/app/views/activity_templates/_generic.html.erb +1 -1
- data/db/migrate/20090818204527_add_activity_indexes.rb +9 -0
- data/db/migrate/20090819030523_add_attachable_to_activities.rb +13 -0
- data/lib/active_record/acts/muck_activity.rb +4 -0
- data/lib/muck_activities/muck_activity_sources.rb +7 -2
- data/locales/ar.yml +15 -11
- data/locales/bg.yml +17 -13
- data/locales/ca.yml +18 -14
- data/locales/cs.yml +16 -12
- data/locales/da.yml +12 -8
- data/locales/de.yml +17 -13
- data/locales/el.yml +15 -11
- data/locales/en.yml +4 -0
- data/locales/es.yml +15 -11
- data/locales/et.yml +17 -13
- data/locales/fa.yml +17 -13
- data/locales/fi.yml +19 -15
- data/locales/fr.yml +15 -11
- data/locales/gl.yml +21 -17
- data/locales/hi.yml +11 -7
- data/locales/hr.yml +15 -11
- data/locales/hu.yml +18 -14
- data/locales/id.yml +19 -15
- data/locales/it.yml +20 -16
- data/locales/iw.yml +16 -12
- data/locales/ja.yml +17 -13
- data/locales/ko.yml +13 -9
- data/locales/lt.yml +13 -9
- data/locales/lv.yml +15 -11
- data/locales/mt.yml +20 -16
- data/locales/nl.yml +15 -11
- data/locales/no.yml +16 -12
- data/locales/pl.yml +13 -9
- data/locales/pt-PT.yml +17 -13
- data/locales/ro.yml +18 -14
- data/locales/ru.yml +14 -10
- data/locales/sk.yml +16 -12
- data/locales/sl.yml +17 -13
- data/locales/sq.yml +19 -15
- data/locales/sr.yml +20 -16
- data/locales/sv.yml +17 -13
- data/locales/th.yml +18 -14
- data/locales/tl.yml +12 -8
- data/locales/tr.yml +17 -13
- data/locales/uk.yml +15 -11
- data/locales/vi.yml +15 -11
- data/locales/zh-CN.yml +13 -9
- data/locales/zh-TW.yml +12 -8
- data/locales/zh.yml +13 -9
- data/muck-activities.gemspec +12 -5
- data/public/javascripts/muck_activities.js +1 -2
- data/test/rails_root/config/environment.rb +1 -1
- data/test/rails_root/config/global_config.yml +4 -0
- data/test/rails_root/db/migrate/20090818204527_add_activity_indexes.rb +9 -0
- data/test/rails_root/db/migrate/20090819030523_add_attachable_to_activities.rb +13 -0
- data/test/rails_root/test/unit/activity_test.rb +24 -1
- data/test/rails_root/test/unit/share_test.rb +1 -1
- metadata +14 -4
@@ -11,20 +11,29 @@ class ActivityTest < ActiveSupport::TestCase
|
|
11
11
|
should_have_many :activity_feeds
|
12
12
|
should_have_many :comments
|
13
13
|
|
14
|
+
should_have_named_scope :since
|
15
|
+
should_have_named_scope :before
|
14
16
|
should_have_named_scope :newest
|
17
|
+
should_have_named_scope :oldest
|
18
|
+
should_have_named_scope :latest
|
15
19
|
should_have_named_scope :only_public
|
20
|
+
should_have_named_scope :filter_by_template
|
21
|
+
#should_have_named_scope :created_by Throws an exception. Test below
|
16
22
|
should_have_named_scope :status_updates
|
17
|
-
|
23
|
+
should_have_named_scope :by_item
|
18
24
|
end
|
19
25
|
|
20
26
|
context "named scopes" do
|
21
27
|
setup do
|
28
|
+
@user = Factory(:user)
|
22
29
|
@old_activity = Factory(:activity, :created_at => 6.weeks.ago)
|
23
30
|
@new_activity = Factory(:activity)
|
24
31
|
@status_activity = Factory(:activity, :template => 'status')
|
25
32
|
@other_activity = Factory(:activity, :template => 'other')
|
26
33
|
@private_activity = Factory(:activity, :is_public => false)
|
27
34
|
@public_activity = Factory(:activity, :is_public => true)
|
35
|
+
@item_activity = Factory(:activity, :item => @user)
|
36
|
+
@source_activity = Factory(:activity, :source => @user)
|
28
37
|
end
|
29
38
|
context "before" do
|
30
39
|
should "only find old activity" do
|
@@ -54,6 +63,20 @@ class ActivityTest < ActiveSupport::TestCase
|
|
54
63
|
assert !activities.include?(@private_activity), "only_public found private activity"
|
55
64
|
end
|
56
65
|
end
|
66
|
+
context "by_item" do
|
67
|
+
should "find activities by the item they are associated with" do
|
68
|
+
activities = Activity.by_item(@user)
|
69
|
+
assert activities.include?(@item_activity), "by_item didn't find item activity"
|
70
|
+
assert !activities.include?(@public_activity), "by_item found public activity"
|
71
|
+
end
|
72
|
+
end
|
73
|
+
context "created_by" do
|
74
|
+
should "find activities by the source they are associated with" do
|
75
|
+
activities = Activity.created_by(@user)
|
76
|
+
assert activities.include?(@source_activity), "created_by didn't find source activity"
|
77
|
+
assert !activities.include?(@public_activity), "created_by found public activity"
|
78
|
+
end
|
79
|
+
end
|
57
80
|
end
|
58
81
|
|
59
82
|
should "require template or item" do
|
@@ -7,7 +7,7 @@ class ShareTest < ActiveSupport::TestCase
|
|
7
7
|
setup do
|
8
8
|
@user = Factory(:user)
|
9
9
|
@share = Factory(:share)
|
10
|
-
@share.
|
10
|
+
@share.add_share_activity([@user])
|
11
11
|
end
|
12
12
|
should_have_many :activities
|
13
13
|
should "delete activities if share is deleted" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: muck-activities
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Ball
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-10 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -60,9 +60,11 @@ files:
|
|
60
60
|
- app/helpers/muck_activity_helper.rb
|
61
61
|
- app/models/activity_feed.rb
|
62
62
|
- app/views/activities/_activity_feed.html.erb
|
63
|
+
- app/views/activities/_activity_scripts.html.erb
|
63
64
|
- app/views/activities/_cached_activities.html.erb
|
64
65
|
- app/views/activities/_comment.html.erb
|
65
66
|
- app/views/activities/_comments.html.erb
|
67
|
+
- app/views/activities/_contribute.html.erb
|
66
68
|
- app/views/activities/_current_status.html.erb
|
67
69
|
- app/views/activities/_current_status_wrapper.html.erb
|
68
70
|
- app/views/activities/_status_update.html.erb
|
@@ -72,6 +74,8 @@ files:
|
|
72
74
|
- config/muck_activities_routes.rb
|
73
75
|
- db/migrate/20090402033319_add_muck_activities.rb
|
74
76
|
- db/migrate/20090730044139_add_comment_cache.rb
|
77
|
+
- db/migrate/20090818204527_add_activity_indexes.rb
|
78
|
+
- db/migrate/20090819030523_add_attachable_to_activities.rb
|
75
79
|
- install.rb
|
76
80
|
- lib/active_record/acts/muck_activity.rb
|
77
81
|
- lib/muck_activities.rb
|
@@ -169,6 +173,8 @@ files:
|
|
169
173
|
- test/rails_root/db/migrate/20090613173314_create_comments.rb
|
170
174
|
- test/rails_root/db/migrate/20090730044139_add_comment_cache.rb
|
171
175
|
- test/rails_root/db/migrate/20090803185323_create_shares.rb
|
176
|
+
- test/rails_root/db/migrate/20090818204527_add_activity_indexes.rb
|
177
|
+
- test/rails_root/db/migrate/20090819030523_add_attachable_to_activities.rb
|
172
178
|
- test/rails_root/features/step_definitions/webrat_steps.rb
|
173
179
|
- test/rails_root/features/support/env.rb
|
174
180
|
- test/rails_root/features/support/paths.rb
|
@@ -345,6 +351,8 @@ files:
|
|
345
351
|
- uninstall.rb
|
346
352
|
has_rdoc: true
|
347
353
|
homepage: http://github.com/jbasdf/muck_activities
|
354
|
+
licenses: []
|
355
|
+
|
348
356
|
post_install_message:
|
349
357
|
rdoc_options:
|
350
358
|
- --charset=UTF-8
|
@@ -365,9 +373,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
365
373
|
requirements: []
|
366
374
|
|
367
375
|
rubyforge_project: muck-activities
|
368
|
-
rubygems_version: 1.3.
|
376
|
+
rubygems_version: 1.3.5
|
369
377
|
signing_key:
|
370
|
-
specification_version:
|
378
|
+
specification_version: 3
|
371
379
|
summary: Activity engine for the muck system
|
372
380
|
test_files:
|
373
381
|
- test/rails_root/app/controllers/application_controller.rb
|
@@ -400,6 +408,8 @@ test_files:
|
|
400
408
|
- test/rails_root/db/migrate/20090613173314_create_comments.rb
|
401
409
|
- test/rails_root/db/migrate/20090730044139_add_comment_cache.rb
|
402
410
|
- test/rails_root/db/migrate/20090803185323_create_shares.rb
|
411
|
+
- test/rails_root/db/migrate/20090818204527_add_activity_indexes.rb
|
412
|
+
- test/rails_root/db/migrate/20090819030523_add_attachable_to_activities.rb
|
403
413
|
- test/rails_root/features/step_definitions/webrat_steps.rb
|
404
414
|
- test/rails_root/features/support/env.rb
|
405
415
|
- test/rails_root/features/support/paths.rb
|