muck-services 0.1.47 → 3.0.0

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 (446) hide show
  1. data/.gitignore +2 -1
  2. data/LICENSE +1 -1
  3. data/README.rdoc +32 -48
  4. data/Rakefile +14 -16
  5. data/VERSION +1 -1
  6. data/app/controllers/admin/muck/feeds_controller.rb +1 -1
  7. data/app/controllers/muck/aggregations_controller.rb +4 -6
  8. data/app/controllers/muck/feed_previews_controller.rb +2 -10
  9. data/app/controllers/muck/feeds_controller.rb +1 -1
  10. data/app/controllers/muck/identity_feeds_controller.rb +2 -6
  11. data/app/controllers/muck/topics_controller.rb +3 -3
  12. data/app/controllers/muck/visits_controller.rb +3 -3
  13. data/app/helpers/muck_services_feeds_helper.rb +3 -3
  14. data/app/helpers/muck_services_service_helper.rb +2 -2
  15. data/app/models/aggregation.rb +4 -18
  16. data/app/models/entry.rb +2 -2
  17. data/app/models/feed.rb +7 -9
  18. data/app/models/oai_endpoint.rb +6 -6
  19. data/app/models/personal_recommendation.rb +4 -5
  20. data/app/models/service.rb +6 -6
  21. data/app/models/service_category.rb +1 -1
  22. data/app/models/services_mailer.rb +10 -12
  23. data/app/views/activity_templates/{_entry_comment.html.erb → _entry_comment.erb} +0 -0
  24. data/app/views/activity_templates/{_entry_share.html.erb → _entry_share.erb} +0 -0
  25. data/app/views/admin/feeds/index.html.erb +8 -9
  26. data/app/views/admin/oai_endpoints/index.html.erb +4 -4
  27. data/app/views/aggregations/{_feeds.html.erb → _feeds.erb} +0 -0
  28. data/app/views/aggregations/edit.html.erb +3 -3
  29. data/app/views/aggregations/index.html.erb +1 -1
  30. data/app/views/aggregations/new.html.erb +1 -1
  31. data/app/views/aggregations/preview.html.erb +1 -1
  32. data/app/views/feed_previews/{new.html.erb → new.erb} +0 -0
  33. data/app/views/feed_previews/{select_feeds.html.erb → select_feeds.erb} +0 -0
  34. data/app/views/feeds/_feed.html.erb +1 -1
  35. data/app/views/feeds/_feed_row.html.erb +1 -1
  36. data/app/views/feeds/_form.html.erb +2 -2
  37. data/app/views/feeds/edit.html.erb +2 -2
  38. data/app/views/feeds/index.html.erb +7 -8
  39. data/app/views/feeds/new.html.erb +2 -2
  40. data/app/views/feeds/new_extended.html.erb +2 -2
  41. data/app/views/feeds/new_oai_rss.html.erb +2 -2
  42. data/app/views/identity_feeds/{_form.html.erb → _form.erb} +1 -1
  43. data/app/views/oai_endpoints/_form.html.erb +2 -2
  44. data/app/views/oai_endpoints/_oai_endpoint_row.html.erb +1 -1
  45. data/app/views/parts/_add_feed.html.erb +1 -1
  46. data/app/views/services_mailer/{notification_feed_added.text.html.erb → notification_feed_added.html.erb} +0 -0
  47. data/app/views/services_mailer/{notification_feed_added.text.plain.erb → notification_feed_added.text.erb} +0 -0
  48. data/app/views/services_mailer/{notification_oai_endpoint_added.text.html.erb → notification_oai_endpoint_added.html.erb} +0 -0
  49. data/app/views/services_mailer/{notification_oai_endpoint_added.text.plain.erb → notification_oai_endpoint_added.text.erb} +0 -0
  50. data/app/views/topics/_form.html.erb +1 -1
  51. data/app/views/topics/new.html.erb +1 -1
  52. data/app/views/visits/_toolbar.html.erb +3 -3
  53. data/{locales → config/locales}/ar.yml +34 -34
  54. data/{locales → config/locales}/bg.yml +34 -34
  55. data/{locales → config/locales}/ca.yml +34 -34
  56. data/{locales → config/locales}/cs.yml +34 -34
  57. data/{locales → config/locales}/da.yml +34 -34
  58. data/{locales → config/locales}/de.yml +34 -34
  59. data/{locales → config/locales}/el.yml +34 -34
  60. data/{locales → config/locales}/en.yml +34 -36
  61. data/{locales → config/locales}/es.yml +34 -34
  62. data/{locales → config/locales}/et.yml +34 -34
  63. data/{locales → config/locales}/fa.yml +34 -34
  64. data/{locales → config/locales}/fi.yml +34 -34
  65. data/{locales → config/locales}/fr.yml +34 -34
  66. data/{locales → config/locales}/gl.yml +34 -34
  67. data/{locales → config/locales}/hi.yml +34 -34
  68. data/{locales → config/locales}/hr.yml +34 -34
  69. data/{locales → config/locales}/hu.yml +34 -34
  70. data/{locales → config/locales}/id.yml +34 -34
  71. data/{locales → config/locales}/it.yml +34 -34
  72. data/{locales → config/locales}/iw.yml +34 -34
  73. data/{locales → config/locales}/ja.yml +34 -34
  74. data/{locales → config/locales}/ko.yml +34 -34
  75. data/{locales → config/locales}/lt.yml +34 -34
  76. data/{locales → config/locales}/lv.yml +34 -34
  77. data/{locales → config/locales}/mt.yml +34 -34
  78. data/{locales → config/locales}/nl.yml +34 -34
  79. data/{locales → config/locales}/no.yml +34 -34
  80. data/{locales → config/locales}/pl.yml +34 -34
  81. data/{locales → config/locales}/pt-PT.yml +34 -34
  82. data/{locales → config/locales}/ro.yml +34 -34
  83. data/{locales → config/locales}/ru.yml +34 -34
  84. data/{locales → config/locales}/sk.yml +34 -34
  85. data/{locales → config/locales}/sl.yml +34 -34
  86. data/{locales → config/locales}/sq.yml +34 -34
  87. data/{locales → config/locales}/sr.yml +34 -34
  88. data/{locales → config/locales}/sv.yml +34 -34
  89. data/{locales → config/locales}/th.yml +34 -34
  90. data/{locales → config/locales}/tl.yml +34 -34
  91. data/{locales → config/locales}/tr.yml +34 -34
  92. data/{locales → config/locales}/uk.yml +34 -34
  93. data/{locales → config/locales}/vi.yml +34 -34
  94. data/{locales → config/locales}/zh-CN.yml +34 -34
  95. data/{locales → config/locales}/zh-TW.yml +34 -34
  96. data/{locales → config/locales}/zh.yml +34 -34
  97. data/config/routes.rb +73 -0
  98. data/lib/muck-services.rb +24 -0
  99. data/lib/muck-services/config.rb +36 -0
  100. data/lib/muck-services/engine.rb +32 -0
  101. data/lib/{muck_services → muck-services}/exceptions.rb +0 -0
  102. data/lib/{muck_services → muck-services}/languages.rb +0 -0
  103. data/lib/muck-services/models/aggregation_owner.rb +17 -0
  104. data/lib/muck-services/models/feed_owner.rb +24 -0
  105. data/lib/muck-services/models/feed_parent.rb +18 -0
  106. data/lib/muck-services/models/recommendation.rb +14 -0
  107. data/lib/muck-services/models/recommendation_owner.rb +15 -0
  108. data/lib/muck-services/models/services_comment.rb +24 -0
  109. data/lib/muck-services/models/services_share.rb +18 -0
  110. data/lib/{muck_services → muck-services}/muck_custom_form_builder.rb +1 -3
  111. data/lib/{muck_services → muck-services}/services.rb +0 -0
  112. data/lib/tasks/muck_services.rake +101 -0
  113. data/muck-services.gemspec +364 -520
  114. data/test/{rails_root → rails_test}/app/controllers/application_controller.rb +1 -9
  115. data/test/{rails_root → rails_test}/app/controllers/default_controller.rb +0 -0
  116. data/test/{rails_root → rails_test}/app/helpers/application_helper.rb +0 -0
  117. data/test/{rails_root → rails_test}/app/models/activity.rb +1 -1
  118. data/test/{rails_root → rails_test}/app/models/comment.rb +3 -3
  119. data/test/rails_test/app/models/country.rb +13 -0
  120. data/test/rails_test/app/models/language.rb +15 -0
  121. data/test/{rails_root → rails_test}/app/models/share.rb +3 -3
  122. data/test/rails_test/app/models/state.rb +13 -0
  123. data/test/{rails_root → rails_test}/app/models/user.rb +8 -8
  124. data/test/{rails_root → rails_test}/app/models/user_session.rb +0 -0
  125. data/test/rails_test/config/application.rb +42 -0
  126. data/test/rails_test/config/boot.rb +13 -0
  127. data/test/rails_test/config/environment.rb +5 -0
  128. data/test/rails_test/config/environments/development.rb +26 -0
  129. data/test/rails_test/config/environments/production.rb +49 -0
  130. data/test/rails_test/config/environments/test.rb +35 -0
  131. data/test/rails_test/config/initializers/backtrace_silencers.rb +7 -0
  132. data/test/{rails_root → rails_test}/config/initializers/inflections.rb +2 -2
  133. data/test/rails_test/config/initializers/mce_options.rb +83 -0
  134. data/test/{rails_root → rails_test}/config/initializers/mime_types.rb +0 -0
  135. data/test/rails_test/config/initializers/muck.rb +66 -0
  136. data/test/rails_test/config/initializers/secret_token.rb +7 -0
  137. data/test/rails_test/config/initializers/session_store.rb +8 -0
  138. data/test/rails_test/config/routes.rb +12 -0
  139. data/test/{rails_root → rails_test}/db/migrate/20090320174818_create_muck_permissions_and_roles.rb +0 -0
  140. data/test/{rails_root → rails_test}/db/migrate/20090327231918_create_users.rb +0 -0
  141. data/test/{rails_root → rails_test}/db/migrate/20090402033319_add_muck_activities.rb +0 -0
  142. data/test/{rails_root → rails_test}/db/migrate/20090402234137_create_languages.rb +0 -0
  143. data/test/{rails_root → rails_test}/db/migrate/20090426041056_create_countries.rb +0 -0
  144. data/test/{rails_root → rails_test}/db/migrate/20090426041103_create_states.rb +0 -0
  145. data/test/rails_test/db/migrate/20090512013727_create_profiles.rb +21 -0
  146. data/test/rails_test/db/migrate/20090517040220_create_uploads.rb +38 -0
  147. data/test/{rails_root → rails_test}/db/migrate/20090602191243_create_muck_raker.rb +0 -0
  148. data/test/{rails_root → rails_test}/db/migrate/20090613173314_create_comments.rb +0 -0
  149. data/test/{rails_root → rails_test}/db/migrate/20090619211125_create_tag_clouds.rb +0 -0
  150. data/test/{rails_root → rails_test}/db/migrate/20090623181458_add_grain_size_to_entries.rb +0 -0
  151. data/test/{rails_root → rails_test}/db/migrate/20090623193525_add_grain_size_to_tag_clouds.rb +0 -0
  152. data/test/rails_test/db/migrate/20090703055724_add_contents.rb +49 -0
  153. data/test/{rails_root → rails_test}/db/migrate/20090703175825_denormalize_entries_subjects.rb +0 -0
  154. data/test/{rails_root → rails_test}/db/migrate/20090704220055_create_slugs.rb +0 -0
  155. data/test/{rails_root → rails_test}/db/migrate/20090716035935_change_tag_cloud_grain_sizes.rb +0 -0
  156. data/test/{rails_root → rails_test}/db/migrate/20090717173900_add_contributor_to_feeds.rb +0 -0
  157. data/test/{rails_root → rails_test}/db/migrate/20090717175825_normalize_entries_subjects.rb +0 -0
  158. data/test/{rails_root → rails_test}/db/migrate/20090721043213_change_services_title_to_name.rb +0 -0
  159. data/test/{rails_root → rails_test}/db/migrate/20090721054927_remove_services_not_null_from_feeds.rb +0 -0
  160. data/test/{rails_root → rails_test}/db/migrate/20090723050510_create_feed_parents.rb +0 -0
  161. data/test/{rails_root → rails_test}/db/migrate/20090728165716_add_etag_to_feeds.rb +0 -0
  162. data/test/{rails_root → rails_test}/db/migrate/20090730044139_add_comment_cache.rb +0 -0
  163. data/test/{rails_root → rails_test}/db/migrate/20090730045848_add_comment_cache_to_entries.rb +0 -0
  164. data/test/{rails_root → rails_test}/db/migrate/20090730154102_allow_null_user.rb +0 -0
  165. data/test/{rails_root → rails_test}/db/migrate/20090803185323_create_shares.rb +0 -0
  166. data/test/{rails_root → rails_test}/db/migrate/20090804184247_add_comment_count_to_shares.rb +0 -0
  167. data/test/{rails_root → rails_test}/db/migrate/20090804211240_add_entry_id_to_shares.rb +0 -0
  168. data/test/{rails_root → rails_test}/db/migrate/20090804231857_add_shares_uri_index.rb +0 -0
  169. data/test/rails_test/db/migrate/20090806230610_add_layout_to_contents.rb +9 -0
  170. data/test/rails_test/db/migrate/20090808175401_add_contents_comment_counter_cache.rb +9 -0
  171. data/test/{rails_root → rails_test}/db/migrate/20090818204527_add_activity_indexes.rb +0 -0
  172. data/test/{rails_root → rails_test}/db/migrate/20090819030523_add_attachable_to_activities.rb +0 -0
  173. data/test/{rails_root → rails_test}/db/migrate/20090826220530_change_services_sequence_to_sort.rb +0 -0
  174. data/test/{rails_root → rails_test}/db/migrate/20090826225652_create_identity_feeds.rb +0 -0
  175. data/test/{rails_root → rails_test}/db/migrate/20090827005105_add_identity_fields_to_services.rb +0 -0
  176. data/test/{rails_root → rails_test}/db/migrate/20090827015308_create_service_categories.rb +0 -0
  177. data/test/{rails_root → rails_test}/db/migrate/20090827221502_add_prompt_and_template_to_services.rb +0 -0
  178. data/test/{rails_root → rails_test}/db/migrate/20090915041650_aggregations_to_polymorphic.rb +0 -0
  179. data/test/{rails_root → rails_test}/db/migrate/20090922174200_update_oai_endpoints.rb +0 -0
  180. data/test/{rails_root → rails_test}/db/migrate/20090922231552_add_dates_to_oai_endpoints.rb +0 -0
  181. data/test/{rails_root → rails_test}/db/migrate/20090923150807_rename_name_in_aggregation.rb +0 -0
  182. data/test/{rails_root → rails_test}/db/migrate/20090924200750_add_uri_data_template_to_services.rb +0 -0
  183. data/test/{rails_root → rails_test}/db/migrate/20091006183742_add_feed_count_to_aggregation.rb +0 -0
  184. data/test/{rails_root → rails_test}/db/migrate/20091022150615_add_uri_key_to_services.rb +0 -0
  185. data/test/{rails_root → rails_test}/db/migrate/20091115011828_add_aggregations_for_personal_recs.rb +0 -0
  186. data/test/{rails_root → rails_test}/db/migrate/20091116094447_rename_action_table.rb +0 -0
  187. data/test/{rails_root → rails_test}/db/migrate/20091118203605_add_default_feed_type_to_aggregation_feed.rb +0 -0
  188. data/test/rails_test/db/migrate/20091124203137_add_location_to_profiles.rb +15 -0
  189. data/test/rails_test/db/migrate/20091124205819_add_fields_to_profiles.rb +21 -0
  190. data/test/{rails_root → rails_test}/db/migrate/20100123035450_create_access_codes.rb +0 -0
  191. data/test/{rails_root → rails_test}/db/migrate/20100123233654_create_access_code_requests.rb +0 -0
  192. data/test/rails_test/db/migrate/20100206000906_remove_name_fields.rb +15 -0
  193. data/test/rails_test/db/migrate/20100903205928_add_dead_entry_fields.rb +13 -0
  194. data/test/{rails_root → rails_test}/features/step_definitions/common_steps.rb +0 -0
  195. data/test/{rails_root → rails_test}/features/step_definitions/visit_steps.rb +0 -0
  196. data/test/rails_test/features/step_definitions/web_steps.rb +219 -0
  197. data/test/{rails_root → rails_test}/features/step_definitions/webrat_steps.rb +0 -0
  198. data/test/rails_test/features/support/custom_env.rb +19 -0
  199. data/test/rails_test/features/support/env.rb +58 -0
  200. data/test/rails_test/features/support/paths.rb +33 -0
  201. data/test/rails_test/lib/daemons/amazonaws.rb +36 -0
  202. data/test/{rails_root → rails_test}/public/dispatch.rb +0 -0
  203. data/test/rails_test/spec/controllers/admin/feeds_controller_spec.rb +38 -0
  204. data/test/rails_test/spec/controllers/admin/oai_endpoints_controller_spec.rb +30 -0
  205. data/test/{rails_root/test/functional/aggregation_feeds_controller_test.rb → rails_test/spec/controllers/aggregation_feeds_controller_spec.rb} +24 -24
  206. data/test/rails_test/spec/controllers/aggregations_controller_spec.rb +89 -0
  207. data/test/rails_test/spec/controllers/feed_previews_controller_spec.rb +32 -0
  208. data/test/rails_test/spec/controllers/feeds_controller_spec.rb +78 -0
  209. data/test/{rails_root/test/functional/identity_feeds_controller_test.rb → rails_test/spec/controllers/identity_feeds_controller_spec.rb} +44 -44
  210. data/test/rails_test/spec/controllers/oai_endpoints_controller_spec.rb +42 -0
  211. data/test/rails_test/spec/controllers/topics_controller_spec.rb +50 -0
  212. data/test/rails_test/spec/controllers/visits_controller_spec.rb +21 -0
  213. data/test/{rails_root/test → rails_test/spec}/factories.rb +6 -1
  214. data/test/rails_test/spec/mailers/services_mailer_spec.rb +31 -0
  215. data/test/{rails_root/test/unit/aggregation_feed_test.rb → rails_test/spec/models/aggregation_feed_spec.rb} +6 -9
  216. data/test/{rails_root/test/unit/aggregation_test.rb → rails_test/spec/models/aggregation_spec.rb} +23 -23
  217. data/test/{rails_root/test/unit/entry_test.rb → rails_test/spec/models/entry_spec.rb} +70 -74
  218. data/test/{rails_root/test/unit/feed_parent_test.rb → rails_test/spec/models/feed_parent_spec.rb} +5 -5
  219. data/test/{rails_root/test/unit/feed_test.rb → rails_test/spec/models/feed_spec.rb} +77 -81
  220. data/test/{rails_root/test/unit/identity_feed_test.rb → rails_test/spec/models/identity_feed_spec.rb} +5 -5
  221. data/test/rails_test/spec/models/oai_endpoint_spec.rb +78 -0
  222. data/test/rails_test/spec/models/personal_recommendation_spec.rb +60 -0
  223. data/test/{rails_root/test/unit/recommendation_test.rb → rails_test/spec/models/recommendation_spec.rb} +6 -8
  224. data/test/rails_test/spec/models/service_category_spec.rb +19 -0
  225. data/test/rails_test/spec/models/service_spec.rb +383 -0
  226. data/test/{rails_root/test/unit/share_test.rb → rails_test/spec/models/share_spec.rb} +8 -11
  227. data/test/{rails_root/test/unit/tag_cloud_test.rb → rails_test/spec/models/tag_cloud_spec.rb} +4 -4
  228. data/test/{rails_root/test/unit/user_test.rb → rails_test/spec/models/user_spec.rb} +9 -11
  229. data/test/{rails_root/test/test_helper.rb → rails_test/spec/spec_helper.rb} +8 -19
  230. metadata +345 -470
  231. data/app/views/services_mailer/notification_feed_added.text.ar.html.erb +0 -4
  232. data/app/views/services_mailer/notification_feed_added.text.ar.plain.erb +0 -7
  233. data/app/views/services_mailer/notification_feed_added.text.bg.html.erb +0 -4
  234. data/app/views/services_mailer/notification_feed_added.text.bg.plain.erb +0 -7
  235. data/app/views/services_mailer/notification_feed_added.text.ca.html.erb +0 -4
  236. data/app/views/services_mailer/notification_feed_added.text.ca.plain.erb +0 -7
  237. data/app/views/services_mailer/notification_feed_added.text.cs.html.erb +0 -4
  238. data/app/views/services_mailer/notification_feed_added.text.cs.plain.erb +0 -7
  239. data/app/views/services_mailer/notification_feed_added.text.da.html.erb +0 -4
  240. data/app/views/services_mailer/notification_feed_added.text.da.plain.erb +0 -7
  241. data/app/views/services_mailer/notification_feed_added.text.de.html.erb +0 -4
  242. data/app/views/services_mailer/notification_feed_added.text.de.plain.erb +0 -7
  243. data/app/views/services_mailer/notification_feed_added.text.el.html.erb +0 -4
  244. data/app/views/services_mailer/notification_feed_added.text.el.plain.erb +0 -7
  245. data/app/views/services_mailer/notification_feed_added.text.es.html.erb +0 -4
  246. data/app/views/services_mailer/notification_feed_added.text.es.plain.erb +0 -7
  247. data/app/views/services_mailer/notification_feed_added.text.et.html.erb +0 -4
  248. data/app/views/services_mailer/notification_feed_added.text.et.plain.erb +0 -7
  249. data/app/views/services_mailer/notification_feed_added.text.fa.html.erb +0 -4
  250. data/app/views/services_mailer/notification_feed_added.text.fa.plain.erb +0 -7
  251. data/app/views/services_mailer/notification_feed_added.text.fi.html.erb +0 -4
  252. data/app/views/services_mailer/notification_feed_added.text.fi.plain.erb +0 -7
  253. data/app/views/services_mailer/notification_feed_added.text.fr.html.erb +0 -4
  254. data/app/views/services_mailer/notification_feed_added.text.fr.plain.erb +0 -7
  255. data/app/views/services_mailer/notification_feed_added.text.gl.html.erb +0 -4
  256. data/app/views/services_mailer/notification_feed_added.text.gl.plain.erb +0 -7
  257. data/app/views/services_mailer/notification_feed_added.text.hi.html.erb +0 -4
  258. data/app/views/services_mailer/notification_feed_added.text.hi.plain.erb +0 -7
  259. data/app/views/services_mailer/notification_feed_added.text.hr.html.erb +0 -4
  260. data/app/views/services_mailer/notification_feed_added.text.hr.plain.erb +0 -7
  261. data/app/views/services_mailer/notification_feed_added.text.hu.html.erb +0 -4
  262. data/app/views/services_mailer/notification_feed_added.text.hu.plain.erb +0 -7
  263. data/app/views/services_mailer/notification_feed_added.text.id.html.erb +0 -4
  264. data/app/views/services_mailer/notification_feed_added.text.id.plain.erb +0 -7
  265. data/app/views/services_mailer/notification_feed_added.text.it.html.erb +0 -4
  266. data/app/views/services_mailer/notification_feed_added.text.it.plain.erb +0 -7
  267. data/app/views/services_mailer/notification_feed_added.text.iw.html.erb +0 -4
  268. data/app/views/services_mailer/notification_feed_added.text.iw.plain.erb +0 -7
  269. data/app/views/services_mailer/notification_feed_added.text.ja.html.erb +0 -4
  270. data/app/views/services_mailer/notification_feed_added.text.ja.plain.erb +0 -7
  271. data/app/views/services_mailer/notification_feed_added.text.ko.html.erb +0 -4
  272. data/app/views/services_mailer/notification_feed_added.text.ko.plain.erb +0 -7
  273. data/app/views/services_mailer/notification_feed_added.text.lt.html.erb +0 -4
  274. data/app/views/services_mailer/notification_feed_added.text.lt.plain.erb +0 -7
  275. data/app/views/services_mailer/notification_feed_added.text.lv.html.erb +0 -4
  276. data/app/views/services_mailer/notification_feed_added.text.lv.plain.erb +0 -7
  277. data/app/views/services_mailer/notification_feed_added.text.mt.html.erb +0 -4
  278. data/app/views/services_mailer/notification_feed_added.text.mt.plain.erb +0 -7
  279. data/app/views/services_mailer/notification_feed_added.text.nl.html.erb +0 -4
  280. data/app/views/services_mailer/notification_feed_added.text.nl.plain.erb +0 -7
  281. data/app/views/services_mailer/notification_feed_added.text.no.html.erb +0 -4
  282. data/app/views/services_mailer/notification_feed_added.text.no.plain.erb +0 -7
  283. data/app/views/services_mailer/notification_feed_added.text.pl.html.erb +0 -4
  284. data/app/views/services_mailer/notification_feed_added.text.pl.plain.erb +0 -7
  285. data/app/views/services_mailer/notification_feed_added.text.pt-PT.html.erb +0 -4
  286. data/app/views/services_mailer/notification_feed_added.text.pt-PT.plain.erb +0 -7
  287. data/app/views/services_mailer/notification_feed_added.text.ro.html.erb +0 -4
  288. data/app/views/services_mailer/notification_feed_added.text.ro.plain.erb +0 -7
  289. data/app/views/services_mailer/notification_feed_added.text.ru.html.erb +0 -4
  290. data/app/views/services_mailer/notification_feed_added.text.ru.plain.erb +0 -7
  291. data/app/views/services_mailer/notification_feed_added.text.sk.html.erb +0 -4
  292. data/app/views/services_mailer/notification_feed_added.text.sk.plain.erb +0 -7
  293. data/app/views/services_mailer/notification_feed_added.text.sl.html.erb +0 -4
  294. data/app/views/services_mailer/notification_feed_added.text.sl.plain.erb +0 -7
  295. data/app/views/services_mailer/notification_feed_added.text.sq.html.erb +0 -4
  296. data/app/views/services_mailer/notification_feed_added.text.sq.plain.erb +0 -7
  297. data/app/views/services_mailer/notification_feed_added.text.sr.html.erb +0 -4
  298. data/app/views/services_mailer/notification_feed_added.text.sr.plain.erb +0 -7
  299. data/app/views/services_mailer/notification_feed_added.text.sv.html.erb +0 -4
  300. data/app/views/services_mailer/notification_feed_added.text.sv.plain.erb +0 -7
  301. data/app/views/services_mailer/notification_feed_added.text.th.html.erb +0 -4
  302. data/app/views/services_mailer/notification_feed_added.text.th.plain.erb +0 -7
  303. data/app/views/services_mailer/notification_feed_added.text.tl.html.erb +0 -4
  304. data/app/views/services_mailer/notification_feed_added.text.tl.plain.erb +0 -7
  305. data/app/views/services_mailer/notification_feed_added.text.tr.html.erb +0 -4
  306. data/app/views/services_mailer/notification_feed_added.text.tr.plain.erb +0 -7
  307. data/app/views/services_mailer/notification_feed_added.text.uk.html.erb +0 -4
  308. data/app/views/services_mailer/notification_feed_added.text.uk.plain.erb +0 -7
  309. data/app/views/services_mailer/notification_feed_added.text.vi.html.erb +0 -4
  310. data/app/views/services_mailer/notification_feed_added.text.vi.plain.erb +0 -7
  311. data/app/views/services_mailer/notification_feed_added.text.zh-CN.html.erb +0 -4
  312. data/app/views/services_mailer/notification_feed_added.text.zh-CN.plain.erb +0 -7
  313. data/app/views/services_mailer/notification_feed_added.text.zh-TW.html.erb +0 -4
  314. data/app/views/services_mailer/notification_feed_added.text.zh-TW.plain.erb +0 -7
  315. data/app/views/services_mailer/notification_feed_added.text.zh.html.erb +0 -4
  316. data/app/views/services_mailer/notification_feed_added.text.zh.plain.erb +0 -7
  317. data/app/views/services_mailer/notification_oai_endpoint_added.text.ar.html.erb +0 -4
  318. data/app/views/services_mailer/notification_oai_endpoint_added.text.ar.plain.erb +0 -4
  319. data/app/views/services_mailer/notification_oai_endpoint_added.text.bg.html.erb +0 -4
  320. data/app/views/services_mailer/notification_oai_endpoint_added.text.bg.plain.erb +0 -4
  321. data/app/views/services_mailer/notification_oai_endpoint_added.text.ca.html.erb +0 -4
  322. data/app/views/services_mailer/notification_oai_endpoint_added.text.ca.plain.erb +0 -4
  323. data/app/views/services_mailer/notification_oai_endpoint_added.text.cs.html.erb +0 -4
  324. data/app/views/services_mailer/notification_oai_endpoint_added.text.cs.plain.erb +0 -4
  325. data/app/views/services_mailer/notification_oai_endpoint_added.text.da.html.erb +0 -4
  326. data/app/views/services_mailer/notification_oai_endpoint_added.text.da.plain.erb +0 -4
  327. data/app/views/services_mailer/notification_oai_endpoint_added.text.de.html.erb +0 -4
  328. data/app/views/services_mailer/notification_oai_endpoint_added.text.de.plain.erb +0 -4
  329. data/app/views/services_mailer/notification_oai_endpoint_added.text.el.html.erb +0 -4
  330. data/app/views/services_mailer/notification_oai_endpoint_added.text.el.plain.erb +0 -4
  331. data/app/views/services_mailer/notification_oai_endpoint_added.text.es.html.erb +0 -4
  332. data/app/views/services_mailer/notification_oai_endpoint_added.text.es.plain.erb +0 -4
  333. data/app/views/services_mailer/notification_oai_endpoint_added.text.et.html.erb +0 -4
  334. data/app/views/services_mailer/notification_oai_endpoint_added.text.et.plain.erb +0 -4
  335. data/app/views/services_mailer/notification_oai_endpoint_added.text.fa.html.erb +0 -4
  336. data/app/views/services_mailer/notification_oai_endpoint_added.text.fa.plain.erb +0 -4
  337. data/app/views/services_mailer/notification_oai_endpoint_added.text.fi.html.erb +0 -4
  338. data/app/views/services_mailer/notification_oai_endpoint_added.text.fi.plain.erb +0 -4
  339. data/app/views/services_mailer/notification_oai_endpoint_added.text.fr.html.erb +0 -4
  340. data/app/views/services_mailer/notification_oai_endpoint_added.text.fr.plain.erb +0 -4
  341. data/app/views/services_mailer/notification_oai_endpoint_added.text.gl.html.erb +0 -4
  342. data/app/views/services_mailer/notification_oai_endpoint_added.text.gl.plain.erb +0 -4
  343. data/app/views/services_mailer/notification_oai_endpoint_added.text.hi.html.erb +0 -4
  344. data/app/views/services_mailer/notification_oai_endpoint_added.text.hi.plain.erb +0 -4
  345. data/app/views/services_mailer/notification_oai_endpoint_added.text.hr.html.erb +0 -4
  346. data/app/views/services_mailer/notification_oai_endpoint_added.text.hr.plain.erb +0 -4
  347. data/app/views/services_mailer/notification_oai_endpoint_added.text.hu.html.erb +0 -4
  348. data/app/views/services_mailer/notification_oai_endpoint_added.text.hu.plain.erb +0 -4
  349. data/app/views/services_mailer/notification_oai_endpoint_added.text.id.html.erb +0 -4
  350. data/app/views/services_mailer/notification_oai_endpoint_added.text.id.plain.erb +0 -4
  351. data/app/views/services_mailer/notification_oai_endpoint_added.text.it.html.erb +0 -4
  352. data/app/views/services_mailer/notification_oai_endpoint_added.text.it.plain.erb +0 -4
  353. data/app/views/services_mailer/notification_oai_endpoint_added.text.iw.html.erb +0 -4
  354. data/app/views/services_mailer/notification_oai_endpoint_added.text.iw.plain.erb +0 -4
  355. data/app/views/services_mailer/notification_oai_endpoint_added.text.ja.html.erb +0 -4
  356. data/app/views/services_mailer/notification_oai_endpoint_added.text.ja.plain.erb +0 -4
  357. data/app/views/services_mailer/notification_oai_endpoint_added.text.ko.html.erb +0 -4
  358. data/app/views/services_mailer/notification_oai_endpoint_added.text.ko.plain.erb +0 -4
  359. data/app/views/services_mailer/notification_oai_endpoint_added.text.lt.html.erb +0 -4
  360. data/app/views/services_mailer/notification_oai_endpoint_added.text.lt.plain.erb +0 -4
  361. data/app/views/services_mailer/notification_oai_endpoint_added.text.lv.html.erb +0 -4
  362. data/app/views/services_mailer/notification_oai_endpoint_added.text.lv.plain.erb +0 -4
  363. data/app/views/services_mailer/notification_oai_endpoint_added.text.mt.html.erb +0 -4
  364. data/app/views/services_mailer/notification_oai_endpoint_added.text.mt.plain.erb +0 -4
  365. data/app/views/services_mailer/notification_oai_endpoint_added.text.nl.html.erb +0 -4
  366. data/app/views/services_mailer/notification_oai_endpoint_added.text.nl.plain.erb +0 -4
  367. data/app/views/services_mailer/notification_oai_endpoint_added.text.no.html.erb +0 -4
  368. data/app/views/services_mailer/notification_oai_endpoint_added.text.no.plain.erb +0 -4
  369. data/app/views/services_mailer/notification_oai_endpoint_added.text.pl.html.erb +0 -4
  370. data/app/views/services_mailer/notification_oai_endpoint_added.text.pl.plain.erb +0 -4
  371. data/app/views/services_mailer/notification_oai_endpoint_added.text.pt-PT.html.erb +0 -4
  372. data/app/views/services_mailer/notification_oai_endpoint_added.text.pt-PT.plain.erb +0 -4
  373. data/app/views/services_mailer/notification_oai_endpoint_added.text.ro.html.erb +0 -4
  374. data/app/views/services_mailer/notification_oai_endpoint_added.text.ro.plain.erb +0 -4
  375. data/app/views/services_mailer/notification_oai_endpoint_added.text.ru.html.erb +0 -4
  376. data/app/views/services_mailer/notification_oai_endpoint_added.text.ru.plain.erb +0 -4
  377. data/app/views/services_mailer/notification_oai_endpoint_added.text.sk.html.erb +0 -4
  378. data/app/views/services_mailer/notification_oai_endpoint_added.text.sk.plain.erb +0 -4
  379. data/app/views/services_mailer/notification_oai_endpoint_added.text.sl.html.erb +0 -4
  380. data/app/views/services_mailer/notification_oai_endpoint_added.text.sl.plain.erb +0 -4
  381. data/app/views/services_mailer/notification_oai_endpoint_added.text.sq.html.erb +0 -4
  382. data/app/views/services_mailer/notification_oai_endpoint_added.text.sq.plain.erb +0 -4
  383. data/app/views/services_mailer/notification_oai_endpoint_added.text.sr.html.erb +0 -4
  384. data/app/views/services_mailer/notification_oai_endpoint_added.text.sr.plain.erb +0 -4
  385. data/app/views/services_mailer/notification_oai_endpoint_added.text.sv.html.erb +0 -4
  386. data/app/views/services_mailer/notification_oai_endpoint_added.text.sv.plain.erb +0 -4
  387. data/app/views/services_mailer/notification_oai_endpoint_added.text.th.html.erb +0 -4
  388. data/app/views/services_mailer/notification_oai_endpoint_added.text.th.plain.erb +0 -4
  389. data/app/views/services_mailer/notification_oai_endpoint_added.text.tl.html.erb +0 -4
  390. data/app/views/services_mailer/notification_oai_endpoint_added.text.tl.plain.erb +0 -4
  391. data/app/views/services_mailer/notification_oai_endpoint_added.text.tr.html.erb +0 -4
  392. data/app/views/services_mailer/notification_oai_endpoint_added.text.tr.plain.erb +0 -4
  393. data/app/views/services_mailer/notification_oai_endpoint_added.text.uk.html.erb +0 -4
  394. data/app/views/services_mailer/notification_oai_endpoint_added.text.uk.plain.erb +0 -4
  395. data/app/views/services_mailer/notification_oai_endpoint_added.text.vi.html.erb +0 -4
  396. data/app/views/services_mailer/notification_oai_endpoint_added.text.vi.plain.erb +0 -4
  397. data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-CN.html.erb +0 -4
  398. data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-CN.plain.erb +0 -4
  399. data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-TW.html.erb +0 -4
  400. data/app/views/services_mailer/notification_oai_endpoint_added.text.zh-TW.plain.erb +0 -4
  401. data/app/views/services_mailer/notification_oai_endpoint_added.text.zh.html.erb +0 -4
  402. data/app/views/services_mailer/notification_oai_endpoint_added.text.zh.plain.erb +0 -4
  403. data/config/muck_services_routes.rb +0 -43
  404. data/lib/active_record/acts/muck_aggregation_owner.rb +0 -30
  405. data/lib/active_record/acts/muck_feed_owner.rb +0 -36
  406. data/lib/active_record/acts/muck_feed_parent.rb +0 -23
  407. data/lib/active_record/acts/muck_recommendations.rb +0 -24
  408. data/lib/active_record/acts/muck_services_comment.rb +0 -40
  409. data/lib/active_record/acts/muck_services_share.rb +0 -32
  410. data/lib/muck_services.rb +0 -23
  411. data/lib/muck_services/initialize_routes.rb +0 -8
  412. data/lib/muck_services/tasks.rb +0 -117
  413. data/rails/init.rb +0 -18
  414. data/test/rails_root/config/boot.rb +0 -109
  415. data/test/rails_root/config/environment.rb +0 -41
  416. data/test/rails_root/config/environments/cucumber.rb +0 -21
  417. data/test/rails_root/config/environments/development.rb +0 -37
  418. data/test/rails_root/config/environments/production.rb +0 -1
  419. data/test/rails_root/config/environments/test.rb +0 -24
  420. data/test/rails_root/config/initializers/requires.rb +0 -13
  421. data/test/rails_root/config/initializers/session_store.rb +0 -8
  422. data/test/rails_root/config/routes.rb +0 -11
  423. data/test/rails_root/db/schema.rb +0 -504
  424. data/test/rails_root/features/support/env.rb +0 -14
  425. data/test/rails_root/features/support/paths.rb +0 -36
  426. data/test/rails_root/script/create_project.rb +0 -52
  427. data/test/rails_root/test/functional/admin/feeds_controller_test.rb +0 -37
  428. data/test/rails_root/test/functional/admin/oai_endpoints_controller_test.rb +0 -30
  429. data/test/rails_root/test/functional/aggregations_controller_test.rb +0 -89
  430. data/test/rails_root/test/functional/feed_previews_controller_test.rb +0 -32
  431. data/test/rails_root/test/functional/feeds_controller_test.rb +0 -78
  432. data/test/rails_root/test/functional/oai_endpoints_controller_test.rb +0 -42
  433. data/test/rails_root/test/functional/topics_controller_test.rb +0 -50
  434. data/test/rails_root/test/functional/visits_controller_test.rb +0 -21
  435. data/test/rails_root/test/unit/comment_test.rb +0 -38
  436. data/test/rails_root/test/unit/oai_endpoint_test.rb +0 -84
  437. data/test/rails_root/test/unit/personal_recommendation_test.rb +0 -78
  438. data/test/rails_root/test/unit/service_category_test.rb +0 -19
  439. data/test/rails_root/test/unit/service_test.rb +0 -386
  440. data/test/rails_root/test/unit/services_mailer_test.rb +0 -35
  441. data/test/rails_root/vendor/plugins/jrails/init.rb +0 -1
  442. data/test/rails_root/vendor/plugins/jrails/install.rb +0 -9
  443. data/test/rails_root/vendor/plugins/jrails/lib/jrails.rb +0 -421
  444. data/test/rails_root/vendor/plugins/jrails/rails/init.rb +0 -15
  445. data/test/rails_root/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb +0 -62
  446. data/test/rails_root/vendor/plugins/ssl_requirement/test/ssl_requirement_test.rb +0 -132
@@ -1,108 +1,108 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
2
 
3
- class Muck::IdentityFeedsControllerTest < ActionController::TestCase
3
+ describe Muck::IdentityFeedsController do
4
4
 
5
- tests Muck::IdentityFeedsController
6
-
7
- context "identity feeds controller" do
5
+ render_views
6
+
7
+ describe "identity feeds controller" do
8
8
 
9
- setup do
9
+ before do
10
10
  @user = Factory(:user)
11
11
  @service = Factory(:service)
12
12
  activate_authlogic
13
13
  login_as @user
14
14
  end
15
15
 
16
- context "GET index" do
17
- setup do
16
+ describe "GET index" do
17
+ before do
18
18
  get :index, :user_id => @user.to_param
19
19
  end
20
- should_not_set_the_flash
21
- should_respond_with :success
22
- should_render_template :index
20
+ it { should_not set_the_flash }
21
+ it { should respond_with :success }
22
+ it { should render_template :index }
23
23
  end
24
24
 
25
- context "GET new" do
26
- setup do
25
+ describe "GET new" do
26
+ before do
27
27
  get :new, :user_id => @user.to_param, :service_id => @service.to_param
28
28
  end
29
- should_not_set_the_flash
30
- should_respond_with :success
31
- should_render_template :new
29
+ it { should_not set_the_flash }
30
+ it { should respond_with :success }
31
+ it { should render_template :new }
32
32
  end
33
33
 
34
- context "POST create using bogus service and bogus uri" do
35
- setup do
34
+ describe "POST create using bogus service and bogus uri" do
35
+ before do
36
36
  @service = Factory(:service)
37
37
  @uri = 'http://www.example.com'
38
38
  post :create, :service_id => @service.to_param, :uri => @uri, :user_id => @user
39
39
  end
40
- should_set_the_flash_to(I18n.t('muck.services.no_feeds_at_uri'))
41
- should_redirect_to("parent") { user_identity_feeds_url(@user.id) }
40
+ it { should set_the_flash.to(I18n.t('muck.services.no_feeds_at_uri')) }
41
+ it { should redirect_to( user_identity_feeds_url(@user.id) ) }
42
42
  end
43
43
 
44
- context "POST create using bogus service and username" do
45
- setup do
44
+ describe "POST create using bogus service and username" do
45
+ before do
46
46
  @service = Factory(:service)
47
47
  post :create, :service_id => @service.to_param, :username => 'test', :user_id => @user, :uri => 'http://www.example.com'
48
48
  end
49
- should_set_the_flash_to(I18n.t('muck.services.no_feeds_from_username'))
50
- should_redirect_to("parent") { user_identity_feeds_url(@user.id) }
49
+ it { should set_the_flash.to(I18n.t('muck.services.no_feeds_from_username')) }
50
+ it { should redirect_to( user_identity_feeds_url(@user.id) ) }
51
51
  end
52
52
 
53
- context "POST create using uri" do
54
- setup do
53
+ describe "POST create using uri" do
54
+ before do
55
55
  @service = Factory(:service)
56
56
  @uri = TEST_URI
57
57
  post :create, :service_id => @service.to_param, :uri => @uri, :user_id => @user
58
58
  end
59
- should "set success in the flash" do
59
+ it "should set success in the flash" do
60
60
  ensure_flash_contains(I18n.t('muck.services.successfully_added_uri_feed'))
61
61
  end
62
62
  end
63
63
 
64
- context "POST create using valid service username" do
65
- setup do
64
+ describe "POST create using valid service username" do
65
+ before do
66
66
  @service = Factory(:service, :uri_data_template => TEST_USERNAME_TEMPLATE)
67
67
  @username = 'jbasdf'
68
68
  end
69
- context "html" do
70
- setup do
69
+ describe "html" do
70
+ before do
71
71
  post :create, :service_id => @service.to_param, :username => @username, :user_id => @user, :uri => 'http://www.example.com'
72
72
  end
73
- should_set_the_flash_to(I18n.t('muck.services.successfully_added_username_feed', :service => ''))
74
- should_redirect_to("parent") { user_identity_feeds_url(@user.id) }
73
+ it { should set_the_flash.to(I18n.t('muck.services.successfully_added_username_feed', :service => '')) }
74
+ it { should redirect_to( user_identity_feeds_url(@user.id) ) }
75
75
  end
76
- context "json" do
77
- setup do
76
+ describe "json" do
77
+ before do
78
78
  post :create, :service_id => @service.to_param, :username => @username, :user_id => @user, :format => 'json'
79
79
  end
80
- should_respond_with :success
80
+ it { should respond_with :success }
81
81
  end
82
82
  end
83
83
 
84
- context "POST create using valid service username - duplicate" do
85
- setup do
84
+ describe "POST create using valid service username - duplicate" do
85
+ before do
86
86
  @service = Factory(:service, :uri_data_template => TEST_USERNAME_TEMPLATE)
87
87
  @username = 'jbasdf'
88
88
  post :create, :service_id => @service.to_param, :username => @username, :user_id => @user, :uri => 'http://www.example.com'
89
89
  post :create, :service_id => @service.to_param, :username => @username, :user_id => @user, :uri => 'http://www.example.com'
90
90
  end
91
- should_set_the_flash_to(I18n.t('muck.services.already_added_username_feed', :service => '', :username => 'jbasdf')) # really do have to hard code the string here. @username is nil
92
- should_redirect_to("parent") { user_identity_feeds_url(@user.id) }
91
+ it { should set_the_flash.to(I18n.t('muck.services.already_added_username_feed', :service => '', :username => 'jbasdf')) } # really do have to hard code the string here. @username is nil
92
+ it { should redirect_to( user_identity_feeds_url(@user.id) ) }
93
93
  end
94
94
 
95
- context "POST create using uri - duplicate" do
96
- setup do
95
+ describe "POST create using uri - duplicate" do
96
+ before do
97
97
  @service = Factory(:service)
98
98
  @uri = TEST_URI
99
99
  post :create, :service_id => @service.to_param, :uri => @uri, :user_id => @user
100
100
  post :create, :service_id => @service.to_param, :uri => @uri, :user_id => @user
101
101
  end
102
- should "set already added in the flash" do
102
+ it "should set already added in the flash" do
103
103
  ensure_flash_contains(I18n.t('muck.services.already_added_uri_feed', :uri => @uri))
104
104
  end
105
- should_redirect_to("parent") { user_identity_feeds_url(@user.id) }
105
+ it { should redirect_to( user_identity_feeds_url(@user.id) ) }
106
106
  end
107
107
 
108
108
  end
@@ -0,0 +1,42 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Muck::OaiEndpointsController do
4
+
5
+ render_views
6
+
7
+ describe "oai endpoints controller" do
8
+
9
+ describe "logged in as admin" do
10
+ before do
11
+ @user = Factory(:user)
12
+ activate_authlogic
13
+ login_as @user
14
+ end
15
+ describe "GET new" do
16
+ before do
17
+ get :new
18
+ end
19
+ it { should_not set_the_flash }
20
+ it { should respond_with :success }
21
+ it { should render_template :new }
22
+ end
23
+ describe "POST create" do
24
+ before do
25
+ post :create, :oai_endpoint => { :uri => 'http://www.example.com', :title => 'example' }
26
+ end
27
+ it { should set_the_flash.to(I18n.t('muck.services.oai_endpoint_successfully_created')) }
28
+ it { should redirect_to( oai_endpoint_url(assigns(:oai_endpoint)) ) }
29
+ end
30
+ describe "GET show" do
31
+ before do
32
+ @oai_endpoint = Factory(:oai_endpoint)
33
+ get :show, :id => @oai_endpoint.to_param
34
+ end
35
+ it { should_not set_the_flash }
36
+ it { should respond_with :success }
37
+ it { should render_template :show }
38
+ end
39
+ end
40
+ end
41
+
42
+ end
@@ -0,0 +1,50 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Muck::TopicsController do
4
+
5
+ render_views
6
+
7
+ describe "topics controller" do
8
+
9
+ before do
10
+ bootstrap_services
11
+ end
12
+
13
+ describe "GET new" do
14
+ before do
15
+ get :new
16
+ end
17
+ it { should_not set_the_flash }
18
+ it { should respond_with :success }
19
+ it { should render_template :new }
20
+ end
21
+
22
+ describe "GET rss_discovery with term defined" do
23
+ before do
24
+ get :rss_discovery, :id => 'ruby,rails'
25
+ end
26
+ it { should_not set_the_flash }
27
+ it { should respond_with :success }
28
+ it { should render_template :rss_discovery }
29
+ end
30
+
31
+ describe "GET show with term defined" do
32
+ before do
33
+ get :show, :id => 'ruby,rails'
34
+ end
35
+ it { should_not set_the_flash }
36
+ it { should respond_with :success }
37
+ it { should render_template :show }
38
+ end
39
+
40
+ describe "GET show without terms" do
41
+ before do
42
+ get :show, :id => ' '
43
+ end
44
+ it { should set_the_flash.to(I18n.t('muck.services.no_terms_error')) }
45
+ it { should redirect_to( new_topic_path ) }
46
+ end
47
+
48
+ end
49
+
50
+ end
@@ -0,0 +1,21 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+
3
+ describe Muck::VisitsController do
4
+
5
+ render_views
6
+
7
+ describe "visits controller" do
8
+
9
+ describe "GET show" do
10
+ before do
11
+ @entry = Factory(:entry)
12
+ get :show, :id => @entry.to_param, :format => 'html'
13
+ end
14
+ it { should_not set_the_flash }
15
+ it { should respond_with :success }
16
+ it { should render_template :show }
17
+ end
18
+
19
+ end
20
+
21
+ end
@@ -1,10 +1,15 @@
1
- Factory.define :share do |f|
1
+ Factory.define :service_share, :class => 'share' do |f|
2
2
  f.uri { Factory.next(:uri) }
3
3
  f.title { Factory.next(:title) }
4
4
  f.shared_by {|a| a.association(:user)}
5
5
  f.entry {|a| a.association(:entry)}
6
6
  end
7
7
 
8
+ Factory.define :personal_recommendation do |r|
9
+ r.personal_recommendable {|a| a.association(:user)}
10
+ r.destination {|a| a.association(:entry)}
11
+ end
12
+
8
13
  Factory.define :recommendation do |r|
9
14
  r.entry {|a| a.association(:entry)}
10
15
  r.dest_entry {|a| a.association(:entry)}
@@ -0,0 +1,31 @@
1
+ require File.dirname(__FILE__) + '/../spec_helper'
2
+ require 'services_mailer'
3
+
4
+ describe ServicesMailer do
5
+
6
+ describe "deliver emails" do
7
+
8
+ before do
9
+ ActionMailer::Base.delivery_method = :test
10
+ ActionMailer::Base.perform_deliveries = true
11
+ ActionMailer::Base.deliveries = []
12
+ end
13
+
14
+ it "should send notification feed added email" do
15
+ feed = Factory(:feed)
16
+ email = ServicesMailer.notification_feed_added(feed).deliver
17
+ ActionMailer::Base.deliveries.should_not be_empty
18
+ [MuckEngine.configuration.admin_email].should == email.to
19
+ [MuckEngine.configuration.from_email].should == email.from
20
+ end
21
+
22
+ it "should send notification oai endpoint added email" do
23
+ oai_endpoint = Factory(:oai_endpoint)
24
+ email = ServicesMailer.notification_oai_endpoint_added(oai_endpoint).deliver
25
+ ActionMailer::Base.deliveries.should_not be_empty
26
+ [MuckEngine.configuration.admin_email].should == email.to
27
+ [MuckEngine.configuration.from_email].should == email.from
28
+ end
29
+
30
+ end
31
+ end
@@ -8,19 +8,16 @@
8
8
  # feed_type :string(255) default("Feed")
9
9
  #
10
10
 
11
- require File.dirname(__FILE__) + '/../test_helper'
11
+ require File.dirname(__FILE__) + '/../spec_helper'
12
12
 
13
- class AggregationFeedTest < ActiveSupport::TestCase
13
+ describe AggregationFeed do
14
14
 
15
- context "aggregation feed" do
16
- setup do
15
+ describe "aggregation feed" do
16
+ before do
17
17
  @aggregation_feed = Factory(:aggregation_feed)
18
18
  end
19
-
20
- subject { @aggregation_feed }
21
-
22
- should_belong_to :aggregation
23
- should_belong_to :feed
19
+ it { should belong_to :aggregation }
20
+ it { should belong_to :feed }
24
21
  end
25
22
 
26
23
  end
@@ -14,71 +14,71 @@
14
14
  # feed_count :integer(4) default(0)
15
15
  #
16
16
 
17
- require File.dirname(__FILE__) + '/../test_helper'
17
+ require File.dirname(__FILE__) + '/../spec_helper'
18
18
 
19
- class AggregationTest < ActiveSupport::TestCase
19
+ describe Aggregation do
20
20
 
21
- context "aggregation" do
22
- setup do
21
+ describe "aggregation" do
22
+ before do
23
23
  @aggregation = Factory(:aggregation)
24
24
  end
25
25
 
26
- subject { @aggregation }
27
26
 
28
- should_belong_to :ownable
29
- should_have_many :aggregation_feeds
30
- should_have_many :feeds
27
+
28
+ it { should belong_to :ownable }
29
+ it { should have_many :aggregation_feeds }
30
+ it { should have_many :feeds }
31
31
 
32
- should_scope_by_title
33
- should_scope_recent
34
- should_scope_newest
32
+ it { should scope_by_title }
33
+ it { should scope_newer_than }
34
+ it { should scope_by_newest }
35
35
 
36
- context "filter feed types" do
37
- setup do
36
+ describe "filter feed types" do
37
+ before do
38
38
  build_music_service
39
39
  Aggregation.delete_all
40
40
  @aggregation = Factory(:aggregation, :terms => 'autumn')
41
41
  @aggregation.add_feeds(nil, nil, true) # Generate all feeds
42
42
  end
43
- should "get all feeds" do
43
+ it "should get all feeds" do
44
44
  assert @aggregation.all_feeds.length > 0
45
45
  assert @aggregation.all_feeds.any?{ |feed| feed.service.photo? }
46
46
  assert @aggregation.all_feeds.any?{ |feed| feed.service.video? }
47
47
  assert @aggregation.all_feeds.any?{ |feed| feed.service.bookmark? }
48
48
  assert @aggregation.all_feeds.any?{ |feed| feed.service.general? }
49
49
  end
50
- should "only get photo feeds" do
50
+ it "should only get photo feeds" do
51
51
  assert @aggregation.photo_feeds(true).length > 0
52
52
  assert @aggregation.photo_feeds.all?{ |feed| feed.service.photo? }
53
53
  end
54
- should "only get video feeds" do
54
+ it "should only get video feeds" do
55
55
  assert @aggregation.video_feeds(true).length > 0
56
56
  assert @aggregation.video_feeds.all?{ |feed| feed.service.video? }
57
57
  end
58
- should "only get bookmark feeds" do
58
+ it "should only get bookmark feeds" do
59
59
  assert @aggregation.bookmark_feeds(true).length > 0
60
60
  assert @aggregation.bookmark_feeds.all?{ |feed| feed.service.bookmark? }
61
61
  end
62
- should "only get music feeds" do
62
+ it "should only get music feeds" do
63
63
  assert @aggregation.music_feeds(true).length > 0
64
64
  assert @aggregation.music_feeds.all?{ |feed| feed.service.music? }
65
65
  end
66
- should "only get general feeds" do
66
+ it "should only get general feeds" do
67
67
  assert @aggregation.general_feeds(true).length > 0
68
68
  assert @aggregation.general_feeds.all?{ |feed| feed.service.general? }
69
69
  end
70
70
 
71
71
  end
72
72
 
73
- context "add_feeds_by_uri" do
74
- setup do
73
+ describe "add_feeds_by_uri" do
74
+ before do
75
75
  @uris = ['http://www.example.com', 'http://www.justinball.com']
76
76
  @aggregation = Factory(:aggregation)
77
77
  @aggregation.add_feeds_by_uri(nil, @uris)
78
78
  @aggregation.reload
79
79
  end
80
- should "add feeds" do
81
- assert_equal @uris.length, @aggregation.feeds.length
80
+ it "should add feeds" do
81
+ @aggregation.feeds.length.should == @uris.length
82
82
  end
83
83
  end
84
84
 
@@ -25,120 +25,116 @@
25
25
  # comment_count :integer(4) default(0)
26
26
  #
27
27
 
28
- require File.dirname(__FILE__) + '/../test_helper'
28
+ require File.dirname(__FILE__) + '/../spec_helper'
29
29
 
30
- class EntryTest < ActiveSupport::TestCase
30
+ describe Entry do
31
31
 
32
- context "entry instance" do
33
- setup do
32
+ describe "entry instance" do
33
+ before do
34
34
  @entry = Factory(:entry)
35
35
  end
36
36
 
37
- subject { @entry }
38
-
39
- should_belong_to :feed
40
-
37
+ it { should belong_to :feed }
41
38
 
42
- context "recommender_entry" do
43
- should "return an entry if the direct_link matches the specified uri" do
39
+ describe "recommender_entry" do
40
+ it "should return an entry if the direct_link matches the specified uri" do
44
41
  uri = Factory.next(:uri)
45
42
  e = Factory.create(:entry, :direct_link => uri)
46
- assert_equal e.id, Entry.recommender_entry(uri).id
43
+ Entry.recommender_entry(uri).id.should == e.id
47
44
  end
48
45
 
49
- should "return an entry if the permalink matches the specified uri" do
46
+ it "should return an entry if the permalink matches the specified uri" do
50
47
  uri = Factory.next(:uri)
51
48
  e = Factory.create(:entry, :permalink => uri)
52
- assert_equal e.id, Entry.recommender_entry(uri).id
49
+ Entry.recommender_entry(uri).id.should == e.id
53
50
  end
54
51
 
55
- should "return an empty entry with the specified uri if the specified uri doesn't match" do
52
+ it "should return an empty entry with the specified uri if the specified uri doesn't match" do
56
53
  uri = Factory.next(:uri)
57
54
  e = Factory.create(:entry, :permalink => uri)
58
- assert_not_nil Entry.recommender_entry(uri)
59
- assert_equal uri, Entry.recommender_entry(uri).permalink
55
+ Entry.recommender_entry(uri).should_not be_nil
56
+ Entry.recommender_entry(uri).permalink.should == uri
60
57
  end
61
58
  end
62
59
 
63
- context "resource_uri" do
64
- should "return the permalink when no direct_link is specified" do
60
+ describe "resource_uri" do
61
+ it "should return the permalink when no direct_link is specified" do
65
62
  @entry.direct_link = nil
66
- assert_equal @entry.permalink, @entry.resource_uri
63
+ @entry.resource_uri.should == @entry.permalink
67
64
  end
68
65
 
69
- should "return the direct_link when a direct_link is specified" do
66
+ it "should return the direct_link when a direct_link is specified" do
70
67
  @entry.direct_link = Factory.next(:uri)
71
- assert_equal @entry.direct_link, @entry.resource_uri
68
+ @entry.resource_uri.should == @entry.direct_link
72
69
  end
73
70
  end
74
71
 
75
- context "search" do
76
- # should "search indexes for ruby" do
72
+ describe "search" do
73
+ # it "should search indexes for ruby" do
77
74
  # Entry.search('ruby', 'all', 'en', 10, 0)
78
75
  # end
79
- should "raise invalid language error" do
80
- assert_raise(MuckServices::Exceptions::LanguageNotSupported) do
81
- Entry.search('ruby', 'all', 'foo', 10, 0)
82
- end
76
+ it "should raise invalid language error" do
77
+ lambda{
78
+ Entry.search('ruby', 'all', 'foo', 10, 0)
79
+ }.should raise_error(MuckServices::Exceptions::LanguageNotSupported)
83
80
  end
84
81
  end
85
82
 
86
- context "normalized_uri" do
87
- should "remove the trailing file name from any url that ends in index.*" do
83
+ describe "normalized_uri" do
84
+ it "should remove the trailing file name from any url that ends in index.*" do
88
85
  index_uri = 'http://example.com/some_dir/'
89
86
  ['html','aspx','shtm','htm','asp','php','cfm','jsp','shtml','jhtml'].each { |ext|
90
- assert_equal index_uri, Entry.normalized_uri(index_uri + 'index.' + ext)
87
+ Entry.normalized_uri(index_uri + 'index.' + ext).should == index_uri
91
88
  }
92
89
  end
93
90
  end
94
91
 
95
- context "recommendation requested omitting certain feeds" do
96
- should "not contain entries from those feeds" do
92
+ describe "recommendation requested omitting certain feeds" do
93
+ it "should not contain entries from those feeds" do
97
94
  feed1_id = Factory(:feed).id
98
95
  feed2_id = Factory(:feed).id
99
- assert_not_equal feed1_id, feed2_id
96
+ feed1_id.should_not == feed2_id
100
97
  Recommendation.create(:entry_id => @entry.id, :dest_entry_id => Factory.create(:entry, :feed_id => feed1_id).id)
101
98
  Recommendation.create(:entry_id => @entry.id, :dest_entry_id => Factory.create(:entry, :feed_id => feed2_id).id)
102
99
  r = @entry.related_entries.top(false, 5, feed2_id.to_s)
103
- assert_equal 1, r.length
100
+ r.length.should == 1
104
101
  r.each { |e| assert_not_equal feed2_id, e.feed_id}
105
102
  end
106
103
  end
107
104
 
108
- context "with 3 recommendations" do
109
-
110
- setup do
105
+ describe "with 3 recommendations" do
106
+ before do
111
107
  3.times { |n| Recommendation.create(:entry_id => @entry.id,
112
108
  :dest_entry_id => Factory(:entry).id, :relevance => n.to_f/10.0) }
113
109
  end
114
110
 
115
- should "have 3 related_entries" do
116
- assert_equal 3, @entry.related_entries.top.length
111
+ it "should have 3 related_entries" do
112
+ @entry.related_entries.top.length.should == 3
117
113
  end
118
114
 
119
- should "return only 2 if specified" do
120
- assert_equal 2, @entry.related_entries.top(true,2).length
115
+ it "should return only 2 if specified" do
116
+ @entry.related_entries.top(true,2).length.should == 2
121
117
  end
122
118
 
123
- should "return results in order of relevance by default" do
119
+ it "should return results in order of relevance by default" do
124
120
  related_entries = @entry.related_entries.top
125
- assert related_entries[1].relevance < related_entries[0].relevance
126
- assert related_entries[2].relevance < related_entries[1].relevance
121
+ related_entries[1].relevance.should < related_entries[0].relevance
122
+ related_entries[2].relevance.should < related_entries[1].relevance
127
123
  end
128
124
 
129
125
  end
130
126
 
131
- context "recommendation requested without details" do
132
- should "not have an author" do
127
+ describe "recommendation requested without details" do
128
+ it "should not have an author" do
133
129
  Recommendation.create(:entry_id => @entry.id,
134
130
  :dest_entry_id => Factory.create(:entry, :author => Factory.next(:name)).id,
135
131
  :relevance => '.3')
136
- assert_raise ActiveRecord::MissingAttributeError do
137
- @entry.related_entries.top.first.author
138
- end
132
+ lambda{
133
+ @entry.related_entries.top.first.author
134
+ }.should raise_error
139
135
  end
140
136
 
141
- should "have basic fields" do
137
+ it "should have basic fields" do
142
138
  title = Factory.next(:name)
143
139
  collection = Factory.next(:name)
144
140
  feed_id = Factory(:feed, :short_title => collection).id
@@ -147,18 +143,18 @@ class EntryTest < ActiveSupport::TestCase
147
143
  recommendation_id = Recommendation.create(:entry_id => @entry.id, :relevance => relevance,
148
144
  :dest_entry_id => dest_entry_id).id.to_s
149
145
  r = @entry.related_entries.top(true).first
150
- assert_nothing_raised do
151
- assert_equal recommendation_id, r.recommendation_id
152
- assert_equal relevance.to_f, r.relevance.to_f
153
- assert_equal title, r.title
154
- assert_equal collection, r.collection
155
- assert_not_nil r.dest_entry_id
156
- end
146
+ lambda do
147
+ r.recommendation_id.should == recommendation_id
148
+ r.relevance.to_f.should == relevance.to_f
149
+ r.title.should == title
150
+ r.collection.should == collection
151
+ r.dest_entry_id.should_not be_nil
152
+ end.should_not raise_error
157
153
  end
158
154
  end
159
155
 
160
- context "recommendation requested with details" do
161
- should "have basic and detailed fields" do
156
+ describe "recommendation requested with details" do
157
+ it "should have basic and detailed fields" do
162
158
  title = Factory.next(:name)
163
159
  collection = Factory.next(:name)
164
160
  author = Factory.next(:name)
@@ -176,21 +172,21 @@ class EntryTest < ActiveSupport::TestCase
176
172
  recommendation_id = Recommendation.create(:entry_id => @entry.id, :relevance => relevance,
177
173
  :avg_time_at_dest => average_time_at_dest, :clicks => clicks, :dest_entry_id => dest_entry_id).id.to_s
178
174
  r = @entry.related_entries.top(true).first
179
- assert_nothing_raised do
180
- assert_equal recommendation_id, r.recommendation_id
181
- assert_equal relevance.to_f, r.relevance.to_f
182
- assert_equal title, r.title
183
- assert_equal collection, r.collection
184
- assert_not_nil r.dest_entry_id
185
-
186
- assert_equal author, r.author
187
- # assert_equal published_at, r.published_at
188
- assert_equal clicks, r.clicks.to_i
189
- assert_equal permalink, r.permalink
190
- assert_equal direct_uri, r.direct_uri
191
- assert_equal average_time_at_dest, r.average_time_at_dest.to_i
192
- assert_equal description, r.description
193
- end
175
+ lambda do
176
+ r.recommendation_id.should == recommendation_id
177
+ r.relevance.to_f.should == relevance.to_f
178
+ r.title.should == title
179
+ r.collection.should == collection
180
+ r.dest_entry_id.should_not be_nil
181
+
182
+ r.author.should == author
183
+ # r.published_at.should == published_at
184
+ r.clicks.to_i.should == clicks
185
+ r.permalink.should == permalink
186
+ r.direct_uri.should == direct_uri
187
+ r.average_time_at_dest.to_i.should == average_time_at_dest
188
+ r.description.should == description
189
+ end.should_not raise_error
194
190
  end
195
191
  end
196
192