muck-friends 0.1.5 → 0.1.6

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.
Files changed (57) hide show
  1. data/README.rdoc +9 -2
  2. data/Rakefile +3 -27
  3. data/VERSION +1 -1
  4. data/app/controllers/muck/friends_controller.rb +28 -11
  5. data/app/helpers/muck_friends_helper.rb +110 -48
  6. data/app/views/activity_templates/_follow.html.erb +3 -0
  7. data/app/views/activity_templates/_friends_with.html.erb +3 -0
  8. data/app/views/friends/_all_friends.html.erb +1 -1
  9. data/app/views/friends/_friend_icon.html.erb +1 -0
  10. data/config/muck_friends_routes.rb +3 -1
  11. data/lib/active_record/acts/muck_friend.rb +14 -22
  12. data/lib/active_record/acts/muck_friend_user.rb +7 -2
  13. data/locales/en.yml +14 -7
  14. data/muck-friends.gemspec +41 -5
  15. data/test/rails_root/Rakefile +15 -0
  16. data/test/rails_root/app/views/default/friend_link.html.erb +1 -0
  17. data/test/rails_root/config/database.yml +4 -1
  18. data/test/rails_root/config/environments/cucumber.rb +22 -0
  19. data/test/rails_root/config/global_config.yml +1 -1
  20. data/test/rails_root/db/migrate/20090402234137_create_languages.rb +18 -0
  21. data/test/rails_root/db/migrate/20090426041056_create_countries.rb +15 -0
  22. data/test/rails_root/db/migrate/20090426041103_create_states.rb +18 -0
  23. data/test/rails_root/db/migrate/20090730044139_add_comment_cache.rb +9 -0
  24. data/test/rails_root/features/step_definitions/webrat_steps.rb +57 -23
  25. data/test/rails_root/features/support/env.rb +14 -3
  26. data/test/rails_root/features/support/paths.rb +27 -0
  27. data/test/rails_root/lib/tasks/cucumber.rake +32 -0
  28. data/test/rails_root/public/images/fancybox/fancy_closebox.png +0 -0
  29. data/test/rails_root/public/images/fancybox/fancy_left.png +0 -0
  30. data/test/rails_root/public/images/fancybox/fancy_progress.png +0 -0
  31. data/test/rails_root/public/images/fancybox/fancy_right.png +0 -0
  32. data/test/rails_root/public/images/fancybox/fancy_shadow_e.png +0 -0
  33. data/test/rails_root/public/images/fancybox/fancy_shadow_n.png +0 -0
  34. data/test/rails_root/public/images/fancybox/fancy_shadow_ne.png +0 -0
  35. data/test/rails_root/public/images/fancybox/fancy_shadow_nw.png +0 -0
  36. data/test/rails_root/public/images/fancybox/fancy_shadow_s.png +0 -0
  37. data/test/rails_root/public/images/fancybox/fancy_shadow_se.png +0 -0
  38. data/test/rails_root/public/images/fancybox/fancy_shadow_sw.png +0 -0
  39. data/test/rails_root/public/images/fancybox/fancy_shadow_w.png +0 -0
  40. data/test/rails_root/public/images/fancybox/fancy_title_left.png +0 -0
  41. data/test/rails_root/public/images/fancybox/fancy_title_main.png +0 -0
  42. data/test/rails_root/public/images/fancybox/fancy_title_right.png +0 -0
  43. data/test/rails_root/public/images/nothing.png +0 -0
  44. data/test/rails_root/public/javascripts/jquery/jquery.easing.js +1 -0
  45. data/test/rails_root/public/javascripts/jquery/jquery.fancybox.js +9 -0
  46. data/test/rails_root/public/javascripts/muck.js +7 -3
  47. data/test/rails_root/public/javascripts/muck_activities.js +1 -1
  48. data/test/rails_root/public/stylesheets/jquery/jquery.fancybox.css +44 -0
  49. data/test/rails_root/public/stylesheets/styles.css +8 -3
  50. data/test/rails_root/script/cucumber +5 -3
  51. data/test/rails_root/test/functional/default_controller_test.rb +177 -4
  52. data/test/rails_root/test/functional/friends_controller_test.rb +8 -8
  53. data/test/rails_root/test/unit/user_test.rb +164 -127
  54. metadata +38 -5
  55. data/app/views/activity_templates/follow.html.erb +0 -1
  56. data/app/views/activity_templates/friends_with.html.erb +0 -1
  57. data/test/rails_root/db/schema.rb +0 -153
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muck-friends
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
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-08-08 00:00:00 -06:00
12
+ date: 2009-08-12 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -59,13 +59,14 @@ files:
59
59
  - app/controllers/muck/friends_controller.rb
60
60
  - app/helpers/muck_friends_helper.rb
61
61
  - app/models/friend_mailer.rb
62
- - app/views/activity_templates/follow.html.erb
63
- - app/views/activity_templates/friends_with.html.erb
62
+ - app/views/activity_templates/_follow.html.erb
63
+ - app/views/activity_templates/_friends_with.html.erb
64
64
  - app/views/friend_mailer/follow.text.html.erb
65
65
  - app/views/friend_mailer/follow.text.plain.erb
66
66
  - app/views/friend_mailer/friend_request.text.html.erb
67
67
  - app/views/friend_mailer/friend_request.text.plain.erb
68
68
  - app/views/friends/_all_friends.html.erb
69
+ - app/views/friends/_friend_icon.html.erb
69
70
  - app/views/friends/_friend_requests.html.erb
70
71
  - app/views/friends/_friend_simple.html.erb
71
72
  - app/views/friends/_mutual_friends.html.erb
@@ -142,6 +143,7 @@ files:
142
143
  - test/rails_root/app/views/default/all_friends.html.erb
143
144
  - test/rails_root/app/views/default/followers.html.erb
144
145
  - test/rails_root/app/views/default/followings.html.erb
146
+ - test/rails_root/app/views/default/friend_link.html.erb
145
147
  - test/rails_root/app/views/default/friend_requests.html.erb
146
148
  - test/rails_root/app/views/default/friends.html.erb
147
149
  - test/rails_root/app/views/default/mutual_friends.html.erb
@@ -150,6 +152,7 @@ files:
150
152
  - test/rails_root/config/boot.rb
151
153
  - test/rails_root/config/database.yml
152
154
  - test/rails_root/config/environment.rb
155
+ - test/rails_root/config/environments/cucumber.rb
153
156
  - test/rails_root/config/environments/development.rb
154
157
  - test/rails_root/config/environments/production.rb
155
158
  - test/rails_root/config/environments/test.rb
@@ -162,11 +165,17 @@ files:
162
165
  - test/rails_root/db/.keep
163
166
  - test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb
164
167
  - test/rails_root/db/migrate/20090402033319_add_muck_activities.rb
168
+ - test/rails_root/db/migrate/20090402234137_create_languages.rb
169
+ - test/rails_root/db/migrate/20090426041056_create_countries.rb
170
+ - test/rails_root/db/migrate/20090426041103_create_states.rb
165
171
  - test/rails_root/db/migrate/20090512013727_create_profiles.rb
166
172
  - test/rails_root/db/migrate/20090602041838_create_users.rb
167
173
  - test/rails_root/db/migrate/20090608073052_create_friends.rb
174
+ - test/rails_root/db/migrate/20090730044139_add_comment_cache.rb
168
175
  - test/rails_root/features/step_definitions/webrat_steps.rb
169
176
  - test/rails_root/features/support/env.rb
177
+ - test/rails_root/features/support/paths.rb
178
+ - test/rails_root/lib/tasks/cucumber.rake
170
179
  - test/rails_root/public/.htaccess
171
180
  - test/rails_root/public/404.html
172
181
  - test/rails_root/public/422.html
@@ -176,11 +185,27 @@ files:
176
185
  - test/rails_root/public/images/arrow_left.gif
177
186
  - test/rails_root/public/images/arrow_right.gif
178
187
  - test/rails_root/public/images/blue/preview.gif
188
+ - test/rails_root/public/images/fancybox/fancy_closebox.png
189
+ - test/rails_root/public/images/fancybox/fancy_left.png
190
+ - test/rails_root/public/images/fancybox/fancy_progress.png
191
+ - test/rails_root/public/images/fancybox/fancy_right.png
192
+ - test/rails_root/public/images/fancybox/fancy_shadow_e.png
193
+ - test/rails_root/public/images/fancybox/fancy_shadow_n.png
194
+ - test/rails_root/public/images/fancybox/fancy_shadow_ne.png
195
+ - test/rails_root/public/images/fancybox/fancy_shadow_nw.png
196
+ - test/rails_root/public/images/fancybox/fancy_shadow_s.png
197
+ - test/rails_root/public/images/fancybox/fancy_shadow_se.png
198
+ - test/rails_root/public/images/fancybox/fancy_shadow_sw.png
199
+ - test/rails_root/public/images/fancybox/fancy_shadow_w.png
200
+ - test/rails_root/public/images/fancybox/fancy_title_left.png
201
+ - test/rails_root/public/images/fancybox/fancy_title_main.png
202
+ - test/rails_root/public/images/fancybox/fancy_title_right.png
179
203
  - test/rails_root/public/images/icons/accept.png
180
204
  - test/rails_root/public/images/icons/add.png
181
205
  - test/rails_root/public/images/icons/delete.png
182
206
  - test/rails_root/public/images/icons/vote.png
183
207
  - test/rails_root/public/images/loading.gif
208
+ - test/rails_root/public/images/nothing.png
184
209
  - test/rails_root/public/images/profile_default.jpg
185
210
  - test/rails_root/public/images/rails.png
186
211
  - test/rails_root/public/images/red/preview.gif
@@ -193,6 +218,8 @@ files:
193
218
  - test/rails_root/public/javascripts/effects.js
194
219
  - test/rails_root/public/javascripts/fancyzoom.min.js
195
220
  - test/rails_root/public/javascripts/jquery/jquery-ui.js
221
+ - test/rails_root/public/javascripts/jquery/jquery.easing.js
222
+ - test/rails_root/public/javascripts/jquery/jquery.fancybox.js
196
223
  - test/rails_root/public/javascripts/jquery/jquery.form.js
197
224
  - test/rails_root/public/javascripts/jquery/jquery.jgrowl.js
198
225
  - test/rails_root/public/javascripts/jquery/jquery.js
@@ -256,6 +283,7 @@ files:
256
283
  - test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_cd0a0a_256x240.png
257
284
  - test/rails_root/public/stylesheets/jquery/cupertino/images/ui-icons_ffffff_256x240.png
258
285
  - test/rails_root/public/stylesheets/jquery/cupertino/jquery-ui-1.7.1.custom.css
286
+ - test/rails_root/public/stylesheets/jquery/jquery.fancybox.css
259
287
  - test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png
260
288
  - test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_flat_55_fbec88_40x100.png
261
289
  - test/rails_root/public/stylesheets/jquery/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png
@@ -389,6 +417,7 @@ test_files:
389
417
  - test/rails_root/app/models/user_session.rb
390
418
  - test/rails_root/config/boot.rb
391
419
  - test/rails_root/config/environment.rb
420
+ - test/rails_root/config/environments/cucumber.rb
392
421
  - test/rails_root/config/environments/development.rb
393
422
  - test/rails_root/config/environments/production.rb
394
423
  - test/rails_root/config/environments/test.rb
@@ -399,12 +428,16 @@ test_files:
399
428
  - test/rails_root/config/routes.rb
400
429
  - test/rails_root/db/migrate/20090320174818_create_muck_permissions_and_roles.rb
401
430
  - test/rails_root/db/migrate/20090402033319_add_muck_activities.rb
431
+ - test/rails_root/db/migrate/20090402234137_create_languages.rb
432
+ - test/rails_root/db/migrate/20090426041056_create_countries.rb
433
+ - test/rails_root/db/migrate/20090426041103_create_states.rb
402
434
  - test/rails_root/db/migrate/20090512013727_create_profiles.rb
403
435
  - test/rails_root/db/migrate/20090602041838_create_users.rb
404
436
  - test/rails_root/db/migrate/20090608073052_create_friends.rb
405
- - test/rails_root/db/schema.rb
437
+ - test/rails_root/db/migrate/20090730044139_add_comment_cache.rb
406
438
  - test/rails_root/features/step_definitions/webrat_steps.rb
407
439
  - test/rails_root/features/support/env.rb
440
+ - test/rails_root/features/support/paths.rb
408
441
  - test/rails_root/public/dispatch.rb
409
442
  - test/rails_root/script/create_project.rb
410
443
  - test/rails_root/test/factories.rb
@@ -1 +0,0 @@
1
- <%= render :partial => 'activity_templates/generic', :locals => { :activity => activity, :activity_css_class => 'activity-follow' } %>
@@ -1 +0,0 @@
1
- <%= render :partial => 'activity_templates/generic', :locals => { :activity => activity, :activity_css_class => 'activity-friends-with' } %>
@@ -1,153 +0,0 @@
1
- # This file is auto-generated from the current state of the database. Instead of editing this file,
2
- # please use the migrations feature of Active Record to incrementally modify your database, and
3
- # then regenerate this schema definition.
4
- #
5
- # Note that this schema.rb definition is the authoritative source for your database schema. If you need
6
- # to create the application database on another system, you should be using db:schema:load, not running
7
- # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
8
- # you'll amass, the slower it'll run and the greater likelihood for issues).
9
- #
10
- # It's strongly recommended to check this file into your version control system.
11
-
12
- ActiveRecord::Schema.define(:version => 20090613173314) do
13
-
14
- create_table "activities", :force => true do |t|
15
- t.integer "item_id"
16
- t.string "item_type"
17
- t.string "template"
18
- t.integer "source_id"
19
- t.string "source_type"
20
- t.text "content"
21
- t.string "title"
22
- t.boolean "is_status_update", :default => false
23
- t.boolean "is_public", :default => true
24
- t.datetime "created_at"
25
- t.datetime "updated_at"
26
- end
27
-
28
- add_index "activities", ["item_id", "item_type"], :name => "index_activities_on_item_id_and_item_type"
29
-
30
- create_table "activity_feeds", :force => true do |t|
31
- t.integer "activity_id"
32
- t.integer "ownable_id"
33
- t.string "ownable_type"
34
- end
35
-
36
- add_index "activity_feeds", ["activity_id"], :name => "index_activity_feeds_on_activity_id"
37
- add_index "activity_feeds", ["ownable_id", "ownable_type"], :name => "index_activity_feeds_on_ownable_id_and_ownable_type"
38
-
39
- create_table "comments", :force => true do |t|
40
- t.integer "commentable_id", :default => 0
41
- t.string "commentable_type", :limit => 15, :default => ""
42
- t.text "body", :default => ""
43
- t.integer "user_id", :default => 0, :null => false
44
- t.integer "parent_id"
45
- t.integer "lft"
46
- t.integer "rgt"
47
- t.integer "is_denied", :default => 0, :null => false
48
- t.boolean "is_reviewed", :default => false
49
- t.datetime "created_at"
50
- t.datetime "updated_at"
51
- end
52
-
53
- add_index "comments", ["commentable_id", "commentable_type"], :name => "index_comments_on_commentable_id_and_commentable_type"
54
- add_index "comments", ["user_id"], :name => "index_comments_on_user_id"
55
-
56
- create_table "countries", :force => true do |t|
57
- t.string "name", :limit => 128, :default => "", :null => false
58
- t.string "abbreviation", :limit => 3, :default => "", :null => false
59
- t.integer "sort", :default => 1000, :null => false
60
- end
61
-
62
- add_index "countries", ["abbreviation"], :name => "index_countries_on_abbreviation"
63
- add_index "countries", ["name"], :name => "index_countries_on_name"
64
-
65
- create_table "friends", :force => true do |t|
66
- t.integer "inviter_id"
67
- t.integer "invited_id"
68
- t.integer "status", :default => 0
69
- t.datetime "created_at"
70
- t.datetime "updated_at"
71
- end
72
-
73
- add_index "friends", ["invited_id", "inviter_id"], :name => "index_friends_on_invited_id_and_inviter_id"
74
- add_index "friends", ["inviter_id", "invited_id"], :name => "index_friends_on_inviter_id_and_invited_id"
75
-
76
- create_table "languages", :force => true do |t|
77
- t.string "name"
78
- t.string "english_name"
79
- t.string "locale"
80
- t.boolean "supported", :default => true
81
- t.integer "is_default", :default => 0
82
- end
83
-
84
- add_index "languages", ["locale"], :name => "index_languages_on_locale"
85
- add_index "languages", ["name"], :name => "index_languages_on_name"
86
-
87
- create_table "permissions", :force => true do |t|
88
- t.integer "role_id", :null => false
89
- t.integer "user_id", :null => false
90
- t.datetime "created_at"
91
- t.datetime "updated_at"
92
- end
93
-
94
- create_table "profiles", :force => true do |t|
95
- t.integer "user_id"
96
- t.string "photo_file_name"
97
- t.string "photo_content_type"
98
- t.integer "photo_file_size"
99
- t.datetime "created_at"
100
- t.datetime "updated_at"
101
- end
102
-
103
- add_index "profiles", ["user_id"], :name => "index_profiles_on_user_id"
104
-
105
- create_table "roles", :force => true do |t|
106
- t.string "rolename"
107
- t.datetime "created_at"
108
- t.datetime "updated_at"
109
- end
110
-
111
- create_table "states", :force => true do |t|
112
- t.string "name", :limit => 128, :default => "", :null => false
113
- t.string "abbreviation", :limit => 3, :default => "", :null => false
114
- t.integer "country_id", :limit => 8, :null => false
115
- end
116
-
117
- add_index "states", ["abbreviation"], :name => "index_states_on_abbreviation"
118
- add_index "states", ["country_id"], :name => "index_states_on_country_id"
119
- add_index "states", ["name"], :name => "index_states_on_name"
120
-
121
- create_table "users", :force => true do |t|
122
- t.string "login"
123
- t.string "email"
124
- t.string "first_name"
125
- t.string "last_name"
126
- t.string "crypted_password"
127
- t.string "password_salt"
128
- t.string "persistence_token"
129
- t.string "single_access_token"
130
- t.string "perishable_token"
131
- t.integer "login_count", :default => 0, :null => false
132
- t.integer "failed_login_count", :default => 0, :null => false
133
- t.datetime "last_request_at"
134
- t.datetime "last_login_at"
135
- t.datetime "current_login_at"
136
- t.string "current_login_ip"
137
- t.string "last_login_ip"
138
- t.boolean "terms_of_service", :default => false, :null => false
139
- t.string "time_zone", :default => "UTC"
140
- t.datetime "disabled_at"
141
- t.datetime "activated_at"
142
- t.datetime "created_at"
143
- t.datetime "updated_at"
144
- end
145
-
146
- add_index "users", ["email"], :name => "index_users_on_email"
147
- add_index "users", ["last_request_at"], :name => "index_users_on_last_request_at"
148
- add_index "users", ["login"], :name => "index_users_on_login"
149
- add_index "users", ["perishable_token"], :name => "index_users_on_perishable_token"
150
- add_index "users", ["persistence_token"], :name => "index_users_on_persistence_token"
151
- add_index "users", ["single_access_token"], :name => "index_users_on_single_access_token"
152
-
153
- end