muck-raker 0.1.15 → 0.1.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) hide show
  1. data/README.rdoc +21 -8
  2. data/Rakefile +6 -0
  3. data/VERSION +1 -1
  4. data/app/controllers/admin/{recommender → muck}/feeds_controller.rb +2 -2
  5. data/app/controllers/{recommender → muck}/entries_controller.rb +8 -5
  6. data/app/controllers/muck/feed_previews_controller.rb +33 -0
  7. data/app/controllers/muck/feeds_controller.rb +128 -0
  8. data/app/controllers/{recommender → muck}/recommendations_controller.rb +4 -1
  9. data/app/controllers/{recommender → muck}/search_controller.rb +3 -1
  10. data/app/helpers/muck_raker_feeds_helper.rb +24 -0
  11. data/app/models/attention.rb +13 -1
  12. data/app/models/click.rb +12 -0
  13. data/app/models/entry.rb +45 -11
  14. data/app/models/feed.rb +81 -7
  15. data/app/models/feed_parent.rb +18 -0
  16. data/app/models/language.rb +14 -0
  17. data/app/models/oai_endpoint.rb +12 -0
  18. data/app/models/raker_mailer.rb +16 -0
  19. data/app/models/recommendation.rb +13 -0
  20. data/app/models/service.rb +14 -0
  21. data/app/models/subject.rb +8 -0
  22. data/app/models/tag_cloud.rb +14 -1
  23. data/app/views/admin/feeds/index.html.erb +65 -0
  24. data/app/views/entries/_related_entry.html.erb +4 -0
  25. data/app/views/entries/_result_status.html.erb +3 -3
  26. data/app/views/entries/details.html.erb +19 -22
  27. data/app/views/entries/index.html.erb +1 -1
  28. data/app/views/entries/show.html.erb +4 -7
  29. data/app/views/feed_previews/new.html.erb +1 -0
  30. data/app/views/feed_previews/select_feeds.html.erb +6 -0
  31. data/app/views/feeds/_entry.html.erb +1 -0
  32. data/app/views/feeds/_feed.html.erb +9 -0
  33. data/app/views/feeds/index.html.erb +30 -94
  34. data/app/views/feeds/new.html.erb +1 -109
  35. data/app/views/feeds/new_extended.html.erb +1 -0
  36. data/app/views/feeds/show.html.erb +6 -0
  37. data/app/views/parts/_add_extended_feed.html.erb +31 -0
  38. data/app/views/parts/_add_feed.html.erb +20 -0
  39. data/app/views/parts/_add_single_feed.html.erb +21 -0
  40. data/app/views/parts/_select_feed.html.erb +4 -0
  41. data/app/views/raker_mailer/notification_feed_added.text.ar.html.erb +3 -0
  42. data/app/views/raker_mailer/notification_feed_added.text.ar.plain.erb +5 -0
  43. data/app/views/raker_mailer/notification_feed_added.text.bg.html.erb +3 -0
  44. data/app/views/raker_mailer/notification_feed_added.text.bg.plain.erb +5 -0
  45. data/app/views/raker_mailer/notification_feed_added.text.ca.html.erb +3 -0
  46. data/app/views/raker_mailer/notification_feed_added.text.ca.plain.erb +5 -0
  47. data/app/views/raker_mailer/notification_feed_added.text.cs.html.erb +3 -0
  48. data/app/views/raker_mailer/notification_feed_added.text.cs.plain.erb +5 -0
  49. data/app/views/raker_mailer/notification_feed_added.text.da.html.erb +3 -0
  50. data/app/views/raker_mailer/notification_feed_added.text.da.plain.erb +5 -0
  51. data/app/views/raker_mailer/notification_feed_added.text.de.html.erb +3 -0
  52. data/app/views/raker_mailer/notification_feed_added.text.de.plain.erb +5 -0
  53. data/app/views/raker_mailer/notification_feed_added.text.el.html.erb +3 -0
  54. data/app/views/raker_mailer/notification_feed_added.text.el.plain.erb +5 -0
  55. data/app/views/raker_mailer/notification_feed_added.text.es.html.erb +3 -0
  56. data/app/views/raker_mailer/notification_feed_added.text.es.plain.erb +5 -0
  57. data/app/views/raker_mailer/notification_feed_added.text.et.html.erb +3 -0
  58. data/app/views/raker_mailer/notification_feed_added.text.et.plain.erb +5 -0
  59. data/app/views/raker_mailer/notification_feed_added.text.fa.html.erb +3 -0
  60. data/app/views/raker_mailer/notification_feed_added.text.fa.plain.erb +5 -0
  61. data/app/views/raker_mailer/notification_feed_added.text.fi.html.erb +3 -0
  62. data/app/views/raker_mailer/notification_feed_added.text.fi.plain.erb +5 -0
  63. data/app/views/raker_mailer/notification_feed_added.text.fr.html.erb +3 -0
  64. data/app/views/raker_mailer/notification_feed_added.text.fr.plain.erb +5 -0
  65. data/app/views/raker_mailer/notification_feed_added.text.gl.html.erb +3 -0
  66. data/app/views/raker_mailer/notification_feed_added.text.gl.plain.erb +5 -0
  67. data/app/views/raker_mailer/notification_feed_added.text.hi.html.erb +3 -0
  68. data/app/views/raker_mailer/notification_feed_added.text.hi.plain.erb +5 -0
  69. data/app/views/raker_mailer/notification_feed_added.text.hr.html.erb +3 -0
  70. data/app/views/raker_mailer/notification_feed_added.text.hr.plain.erb +5 -0
  71. data/app/views/raker_mailer/notification_feed_added.text.html.erb +3 -0
  72. data/app/views/raker_mailer/notification_feed_added.text.hu.html.erb +3 -0
  73. data/app/views/raker_mailer/notification_feed_added.text.hu.plain.erb +5 -0
  74. data/app/views/raker_mailer/notification_feed_added.text.id.html.erb +3 -0
  75. data/app/views/raker_mailer/notification_feed_added.text.id.plain.erb +5 -0
  76. data/app/views/raker_mailer/notification_feed_added.text.it.html.erb +3 -0
  77. data/app/views/raker_mailer/notification_feed_added.text.it.plain.erb +5 -0
  78. data/app/views/raker_mailer/notification_feed_added.text.iw.html.erb +3 -0
  79. data/app/views/raker_mailer/notification_feed_added.text.iw.plain.erb +5 -0
  80. data/app/views/raker_mailer/notification_feed_added.text.ja.html.erb +3 -0
  81. data/app/views/raker_mailer/notification_feed_added.text.ja.plain.erb +5 -0
  82. data/app/views/raker_mailer/notification_feed_added.text.ko.html.erb +3 -0
  83. data/app/views/raker_mailer/notification_feed_added.text.ko.plain.erb +5 -0
  84. data/app/views/raker_mailer/notification_feed_added.text.lt.html.erb +3 -0
  85. data/app/views/raker_mailer/notification_feed_added.text.lt.plain.erb +5 -0
  86. data/app/views/raker_mailer/notification_feed_added.text.lv.html.erb +3 -0
  87. data/app/views/raker_mailer/notification_feed_added.text.lv.plain.erb +5 -0
  88. data/app/views/raker_mailer/notification_feed_added.text.mt.html.erb +3 -0
  89. data/app/views/raker_mailer/notification_feed_added.text.mt.plain.erb +5 -0
  90. data/app/views/raker_mailer/notification_feed_added.text.nl.html.erb +3 -0
  91. data/app/views/raker_mailer/notification_feed_added.text.nl.plain.erb +5 -0
  92. data/app/views/raker_mailer/notification_feed_added.text.no.html.erb +3 -0
  93. data/app/views/raker_mailer/notification_feed_added.text.no.plain.erb +5 -0
  94. data/app/views/raker_mailer/notification_feed_added.text.pl.html.erb +3 -0
  95. data/app/views/raker_mailer/notification_feed_added.text.pl.plain.erb +5 -0
  96. data/app/views/raker_mailer/notification_feed_added.text.plain.erb +5 -0
  97. data/app/views/raker_mailer/notification_feed_added.text.pt-PT.html.erb +3 -0
  98. data/app/views/raker_mailer/notification_feed_added.text.pt-PT.plain.erb +5 -0
  99. data/app/views/raker_mailer/notification_feed_added.text.ro.html.erb +3 -0
  100. data/app/views/raker_mailer/notification_feed_added.text.ro.plain.erb +5 -0
  101. data/app/views/raker_mailer/notification_feed_added.text.ru.html.erb +3 -0
  102. data/app/views/raker_mailer/notification_feed_added.text.ru.plain.erb +5 -0
  103. data/app/views/raker_mailer/notification_feed_added.text.sk.html.erb +3 -0
  104. data/app/views/raker_mailer/notification_feed_added.text.sk.plain.erb +5 -0
  105. data/app/views/raker_mailer/notification_feed_added.text.sl.html.erb +3 -0
  106. data/app/views/raker_mailer/notification_feed_added.text.sl.plain.erb +5 -0
  107. data/app/views/raker_mailer/notification_feed_added.text.sq.html.erb +3 -0
  108. data/app/views/raker_mailer/notification_feed_added.text.sq.plain.erb +5 -0
  109. data/app/views/raker_mailer/notification_feed_added.text.sr.html.erb +3 -0
  110. data/app/views/raker_mailer/notification_feed_added.text.sr.plain.erb +5 -0
  111. data/app/views/raker_mailer/notification_feed_added.text.sv.html.erb +3 -0
  112. data/app/views/raker_mailer/notification_feed_added.text.sv.plain.erb +5 -0
  113. data/app/views/raker_mailer/notification_feed_added.text.th.html.erb +3 -0
  114. data/app/views/raker_mailer/notification_feed_added.text.th.plain.erb +5 -0
  115. data/app/views/raker_mailer/notification_feed_added.text.tl.html.erb +3 -0
  116. data/app/views/raker_mailer/notification_feed_added.text.tl.plain.erb +5 -0
  117. data/app/views/raker_mailer/notification_feed_added.text.tr.html.erb +3 -0
  118. data/app/views/raker_mailer/notification_feed_added.text.tr.plain.erb +5 -0
  119. data/app/views/raker_mailer/notification_feed_added.text.uk.html.erb +3 -0
  120. data/app/views/raker_mailer/notification_feed_added.text.uk.plain.erb +5 -0
  121. data/app/views/raker_mailer/notification_feed_added.text.vi.html.erb +3 -0
  122. data/app/views/raker_mailer/notification_feed_added.text.vi.plain.erb +5 -0
  123. data/app/views/raker_mailer/notification_feed_added.text.zh-CN.html.erb +3 -0
  124. data/app/views/raker_mailer/notification_feed_added.text.zh-CN.plain.erb +5 -0
  125. data/app/views/raker_mailer/notification_feed_added.text.zh-TW.html.erb +3 -0
  126. data/app/views/raker_mailer/notification_feed_added.text.zh-TW.plain.erb +5 -0
  127. data/app/views/raker_mailer/notification_feed_added.text.zh.html.erb +3 -0
  128. data/app/views/raker_mailer/notification_feed_added.text.zh.plain.erb +5 -0
  129. data/app/views/recommendations/index.xml.builder +4 -4
  130. data/config/muck_raker_routes.rb +10 -13
  131. data/db/migrate/20090623181458_add_grain_size_to_entries.rb +6 -6
  132. data/db/migrate/20090623193525_add_grain_size_to_tag_clouds.rb +12 -0
  133. data/db/migrate/20090717175825_normalize_entries_subjects.rb +1 -0
  134. data/db/migrate/20090721043213_change_services_title_to_name.rb +9 -0
  135. data/db/migrate/20090721054927_remove_services_not_null_from_feeds.rb +9 -0
  136. data/db/migrate/20090723050510_create_feed_parents.rb +17 -0
  137. data/lib/active_record/acts/muck_feed_parent.rb +22 -0
  138. data/lib/muck_raker/muck_custom_form_builder.rb +22 -0
  139. data/lib/muck_raker/services.rb +6 -0
  140. data/lib/muck_raker/tasks.rb +8 -4
  141. data/lib/muck_raker.rb +7 -2
  142. data/locales/ar.yml +48 -15
  143. data/locales/bg.yml +48 -15
  144. data/locales/ca.yml +48 -15
  145. data/locales/cs.yml +48 -15
  146. data/locales/da.yml +48 -15
  147. data/locales/de.yml +48 -15
  148. data/locales/el.yml +48 -15
  149. data/locales/en.yml +46 -17
  150. data/locales/es.yml +48 -15
  151. data/locales/et.yml +48 -15
  152. data/locales/fa.yml +48 -15
  153. data/locales/fi.yml +49 -16
  154. data/locales/fr.yml +48 -15
  155. data/locales/gl.yml +48 -15
  156. data/locales/hi.yml +48 -15
  157. data/locales/hr.yml +48 -15
  158. data/locales/hu.yml +48 -15
  159. data/locales/id.yml +48 -15
  160. data/locales/it.yml +49 -16
  161. data/locales/iw.yml +48 -15
  162. data/locales/ja.yml +48 -15
  163. data/locales/ko.yml +48 -15
  164. data/locales/lt.yml +48 -15
  165. data/locales/lv.yml +48 -15
  166. data/locales/mt.yml +48 -15
  167. data/locales/nl.yml +48 -15
  168. data/locales/no.yml +48 -15
  169. data/locales/pl.yml +48 -15
  170. data/locales/pt-PT.yml +48 -15
  171. data/locales/ro.yml +48 -15
  172. data/locales/ru.yml +48 -15
  173. data/locales/sk.yml +48 -15
  174. data/locales/sl.yml +48 -15
  175. data/locales/sq.yml +48 -15
  176. data/locales/sr.yml +48 -15
  177. data/locales/sv.yml +48 -15
  178. data/locales/th.yml +48 -15
  179. data/locales/tl.yml +48 -15
  180. data/locales/tr.yml +48 -15
  181. data/locales/uk.yml +48 -15
  182. data/locales/vi.yml +48 -15
  183. data/locales/zh-CN.yml +48 -15
  184. data/locales/zh-TW.yml +48 -15
  185. data/locales/zh.yml +48 -15
  186. data/muck-raker.gemspec +298 -26
  187. data/rails/init.rb +0 -9
  188. data/test/rails_root/app/models/user.rb +31 -1
  189. data/test/rails_root/app/views/default/index.html.erb +15 -0
  190. data/test/rails_root/app/views/layouts/default.html.erb +38 -24
  191. data/test/rails_root/app/views/layouts/popup.html.erb +40 -0
  192. data/test/rails_root/config/database.yml +12 -11
  193. data/test/rails_root/config/environment.rb +4 -1
  194. data/test/rails_root/config/global_config.yml +3 -0
  195. data/test/rails_root/db/migrate/20090402234137_create_languages.rb +18 -0
  196. data/test/rails_root/db/migrate/20090426041056_create_countries.rb +15 -0
  197. data/test/rails_root/db/migrate/20090426041103_create_states.rb +18 -0
  198. data/test/rails_root/{migrate → db/migrate}/20090602191243_create_muck_raker.rb +0 -0
  199. data/test/rails_root/{migrate → db/migrate}/20090619211125_create_tag_clouds.rb +0 -0
  200. data/test/rails_root/db/migrate/20090623181458_add_grain_size_to_entries.rb +16 -0
  201. data/test/rails_root/db/migrate/20090623193525_add_grain_size_to_tag_clouds.rb +12 -0
  202. data/test/rails_root/{migrate → db/migrate}/20090703175825_denormalize_entries_subjects.rb +0 -0
  203. data/test/rails_root/db/migrate/20090716035935_change_tag_cloud_grain_sizes.rb +9 -0
  204. data/test/rails_root/db/migrate/20090717175825_normalize_entries_subjects.rb +18 -0
  205. data/test/rails_root/db/migrate/20090721043213_change_services_title_to_name.rb +9 -0
  206. data/test/rails_root/db/migrate/20090721054927_remove_services_not_null_from_feeds.rb +9 -0
  207. data/test/rails_root/db/migrate/20090723050510_create_feed_parents.rb +17 -0
  208. data/test/rails_root/db/schema.rb +289 -54
  209. data/test/rails_root/public/images/fancybox/fancy_closebox.png +0 -0
  210. data/test/rails_root/public/images/fancybox/fancy_left.png +0 -0
  211. data/test/rails_root/public/images/fancybox/fancy_progress.png +0 -0
  212. data/test/rails_root/public/images/fancybox/fancy_right.png +0 -0
  213. data/test/rails_root/public/images/fancybox/fancy_shadow_e.png +0 -0
  214. data/test/rails_root/public/images/fancybox/fancy_shadow_n.png +0 -0
  215. data/test/rails_root/public/images/fancybox/fancy_shadow_ne.png +0 -0
  216. data/test/rails_root/public/images/fancybox/fancy_shadow_nw.png +0 -0
  217. data/test/rails_root/public/images/fancybox/fancy_shadow_s.png +0 -0
  218. data/test/rails_root/public/images/fancybox/fancy_shadow_se.png +0 -0
  219. data/test/rails_root/public/images/fancybox/fancy_shadow_sw.png +0 -0
  220. data/test/rails_root/public/images/fancybox/fancy_shadow_w.png +0 -0
  221. data/test/rails_root/public/images/fancybox/fancy_title_left.png +0 -0
  222. data/test/rails_root/public/images/fancybox/fancy_title_main.png +0 -0
  223. data/test/rails_root/public/images/fancybox/fancy_title_right.png +0 -0
  224. data/test/rails_root/public/javascripts/jquery/jquery.easing.js +1 -0
  225. data/test/rails_root/public/javascripts/jquery/jquery.fancybox.js +9 -0
  226. data/test/rails_root/public/javascripts/muck.js +7 -3
  227. data/test/rails_root/public/stylesheets/application.css +1 -0
  228. data/test/rails_root/public/stylesheets/jquery/jquery.fancybox.css +44 -0
  229. data/test/rails_root/public/stylesheets/styles.css +6 -2
  230. data/test/rails_root/test/factories.rb +14 -1
  231. data/test/rails_root/test/functional/feed_previews_controller_test.rb +32 -0
  232. data/test/rails_root/test/functional/feeds_controller_test.rb +57 -5
  233. data/test/rails_root/test/shoulda_macros/controller.rb +5 -1
  234. data/test/rails_root/test/test_helper.rb +2 -0
  235. data/test/rails_root/test/unit/entry_test.rb +30 -5
  236. data/test/rails_root/test/unit/feed_parent_test.rb +10 -0
  237. data/test/rails_root/test/unit/feed_test.rb +55 -3
  238. data/test/rails_root/test/unit/raker_mailer_test.rb +26 -0
  239. data/test/rails_root/test/unit/tag_cloud_test.rb +16 -28
  240. data/test/rails_root/test/unit/user_test.rb +11 -0
  241. metadata +211 -18
  242. data/app/controllers/recommender/default_controller.rb +0 -15
  243. data/app/controllers/recommender/feeds_controller.rb +0 -64
  244. data/app/views/default/tour.html.erb +0 -15
  245. data/app/views/default/widgets.html.erb +0 -4
  246. data/test/rails_root/migrate/20090623181458_add_grain_size_to_entries.rb +0 -16
@@ -3,12 +3,64 @@ require File.dirname(__FILE__) + '/../test_helper'
3
3
  class Muck::FeedsControllerTest < ActionController::TestCase
4
4
 
5
5
  tests Muck::FeedsController
6
-
6
+
7
7
  context "feeds controller" do
8
- setup do
9
- @quentin = Factory(:user)
10
- @aaron = Factory(:user)
8
+
9
+ context "GET index" do
10
+ setup do
11
+ get :index
12
+ end
13
+ should_not_set_the_flash
14
+ should_respond_with :success
15
+ should_render_template :index
16
+ end
17
+
18
+ context "GET show" do
19
+ setup do
20
+ @feed = Factory(:feed)
21
+ get :show, :id => @feed.to_param, :format => 'html'
22
+ end
23
+ should_not_set_the_flash
24
+ should_respond_with :success
25
+ should_render_template :show
26
+ end
27
+
28
+ context "GET new" do
29
+ setup do
30
+ get :new
31
+ end
32
+ should_not_set_the_flash
33
+ should_respond_with :success
34
+ should_render_template :new
11
35
  end
12
36
 
37
+ context "GET new_extended" do
38
+ setup do
39
+ get :new_extended
40
+ end
41
+ should_not_set_the_flash
42
+ should_respond_with :success
43
+ should_render_template :new_extended
44
+ end
45
+
46
+ context "POST create (simple)" do
47
+ setup do
48
+ post :create, :feed => { :uri => TEST_RSS_URI }
49
+ end
50
+ should_set_the_flash_to(I18n.t('muck.raker.feed_successfully_created'))
51
+ end
52
+
53
+ context "POST create (advanced)" do
54
+ setup do
55
+ post :create, :feed => { :uri => TEST_RSS_URI,
56
+ :display_uri => 'http://www.example.com',
57
+ :title => 'test feed long',
58
+ :short_title => 'test feed',
59
+ :description => 'foo bar' }
60
+ end
61
+ should_set_the_flash_to(I18n.t('muck.raker.feed_successfully_created'))
62
+ end
63
+
13
64
  end
14
- end
65
+
66
+ end
@@ -5,7 +5,11 @@ module MuckControllerMacros
5
5
  login_url = args.delete :login_url
6
6
  args.each do |action, verb|
7
7
  should "Require login for '#{action}' action" do
8
- send(verb, action)
8
+ if [:put, :delete].include?(verb) # put and delete require an id even if it is a bogus one
9
+ send(verb, action, :id => 1)
10
+ else
11
+ send(verb, action)
12
+ end
9
13
  assert_redirected_to(login_url)
10
14
  end
11
15
  end
@@ -16,6 +16,8 @@ class ActiveSupport::TestCase
16
16
  self.use_transactional_fixtures = true
17
17
  self.use_instantiated_fixtures = false
18
18
 
19
+ TEST_RSS_URI = 'http://www.engadget.com'
20
+
19
21
  include Authlogic::TestCase
20
22
 
21
23
  def login_as(user)
@@ -1,13 +1,38 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: entries
4
+ #
5
+ # id :integer(4) not null, primary key
6
+ # feed_id :integer(4) not null
7
+ # permalink :string(2083) default(""), not null
8
+ # author :string(2083)
9
+ # title :text default(""), not null
10
+ # description :text
11
+ # content :text
12
+ # unique_content :boolean(1)
13
+ # published_at :datetime not null
14
+ # entry_updated_at :datetime
15
+ # harvested_at :datetime
16
+ # oai_identifier :string(2083)
17
+ # language_id :integer(4)
18
+ # direct_link :string(2083)
19
+ # indexed_at :datetime default(Fri Jan 01 01:01:01 UTC 1971), not null
20
+ # relevance_calculated_at :datetime default(Fri Jan 01 01:01:01 UTC 1971), not null
21
+ # popular :text
22
+ # relevant :text
23
+ # other :text
24
+ # grain_size :string(255) default("unknown")
25
+ #
26
+
1
27
  require File.dirname(__FILE__) + '/../test_helper'
2
28
 
3
- class FeedTest < ActiveSupport::TestCase
29
+ class EntryTest < ActiveSupport::TestCase
4
30
 
5
- context "feed instance" do
31
+ context "entry instance" do
6
32
  setup do
33
+ @entry = Factory(:entry)
7
34
  end
8
-
9
35
  should_belong_to :feed
10
-
11
36
  end
12
37
 
13
- end
38
+ end
@@ -0,0 +1,10 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class FeedParentTest < ActiveSupport::TestCase
4
+
5
+ context "A feed parent instance" do
6
+ should_belong_to :feed
7
+ should_belong_to :ownable
8
+ end
9
+
10
+ end
@@ -1,3 +1,37 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: feeds
4
+ #
5
+ # id :integer(4) not null, primary key
6
+ # uri :string(2083)
7
+ # display_uri :string(2083)
8
+ # title :string(1000)
9
+ # short_title :string(100)
10
+ # description :text
11
+ # tag_filter :string(1000)
12
+ # top_tags :text
13
+ # priority :integer(4) default(10)
14
+ # status :integer(4) default(1)
15
+ # last_requested_at :datetime
16
+ # last_harvested_at :datetime
17
+ # harvest_interval :integer(4) default(86400)
18
+ # failed_requests :integer(4) default(0)
19
+ # error_message :text
20
+ # service_id :integer(4) default(0)
21
+ # login :string(255)
22
+ # password :string(255)
23
+ # created_at :datetime
24
+ # updated_at :datetime
25
+ # entries_changed_at :datetime
26
+ # harvested_from_display_uri :string(2083)
27
+ # harvested_from_title :string(1000)
28
+ # harvested_from_short_title :string(100)
29
+ # entries_count :integer(4)
30
+ # default_language_id :integer(4) default(0)
31
+ # default_grain_size :string(255) default("unknown")
32
+ # contributor_id :integer(4)
33
+ #
34
+
1
35
  require File.dirname(__FILE__) + '/../test_helper'
2
36
 
3
37
  # Used to test muck_content_permission
@@ -7,10 +41,28 @@ class FeedTest < ActiveSupport::TestCase
7
41
  setup do
8
42
  @feed = Factory(:feed)
9
43
  end
10
-
44
+ should_have_many :feed_parents
11
45
  should_have_many :entries
12
46
  should_belong_to :contributor
13
-
47
+ should_belong_to :default_language
48
+
49
+ should_validate_presence_of :uri
50
+
51
+ should_have_named_scope :by_newest
52
+ should_have_named_scope :banned
53
+ should_have_named_scope :valid
54
+ should_have_named_scope :by_title
55
+ should_have_named_scope :recent
56
+
57
+ end
58
+
59
+ context "Get feed information" do
60
+ setup do
61
+ @valid_uri = TEST_RSS_URI
62
+ end
63
+ should "Get feed information" do
64
+ Feed.gather_information(@valid_uri)
65
+ end
14
66
  end
15
67
 
16
- end
68
+ end
@@ -0,0 +1,26 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+ require 'raker_mailer'
3
+
4
+ class RakerMailerTest < ActiveSupport::TestCase
5
+
6
+ context "deliver emails" do
7
+
8
+ def setup
9
+ ActionMailer::Base.delivery_method = :test
10
+ ActionMailer::Base.perform_deliveries = true
11
+ ActionMailer::Base.deliveries = []
12
+ @expected = TMail::Mail.new
13
+ @expected.set_content_type "text", "plain", { "charset" => 'utf-8' }
14
+ end
15
+
16
+ should "send notification feed added email" do
17
+ feed = Factory(:feed)
18
+ response = RakerMailer.deliver_notification_feed_added(feed)
19
+ assert !ActionMailer::Base.deliveries.empty?, "No email was sent"
20
+ email = ActionMailer::Base.deliveries.last
21
+ assert_equal email.to, [GlobalConfig.admin_email]
22
+ assert_equal email.from, [GlobalConfig.from_email]
23
+ end
24
+
25
+ end
26
+ end
@@ -1,35 +1,23 @@
1
+ # == Schema Information
2
+ #
3
+ # Table name: tag_clouds
4
+ #
5
+ # id :integer(4) not null, primary key
6
+ # language_id :integer(4)
7
+ # filter :string(255)
8
+ # tag_list :string(5000)
9
+ # grain_size :string(255) default("all")
10
+ #
11
+
1
12
  require File.dirname(__FILE__) + '/../test_helper'
2
13
 
3
14
  # Used to test muck_content_translation
4
- class ContentTranslationTest < ActiveSupport::TestCase
15
+ class TagCloudTest < ActiveSupport::TestCase
5
16
 
6
- context "A content translation instance" do
7
- should_belong_to :content
8
- should_have_named_scope :by_newest
9
- should_have_named_scope :recent
10
- should_have_named_scope :by_alpha
11
- should_have_named_scope :by_locale
12
- end
13
-
14
- context "find by locale" do
15
- setup do
16
- ContentTranslation.destroy_all
17
- @content_one = Factory(:content)
18
- @content_two = Factory(:content)
19
- end
20
- should "find two English translations" do
21
- translations = ContentTranslation.by_locale('en')
22
- assert_equal 2, translations.length
23
- end
24
- should "find two Spanish translations" do
25
- translations = ContentTranslation.by_locale('es')
26
- assert_equal 2, translations.length
27
- end
28
- should "delete translations" do
29
- assert_difference "ContentTranslation.count", -(@content_two.content_translations.count) do
30
- @content_two.destroy
31
- end
17
+ context "A tag cloud instance" do
18
+ should "get cached tag cloud" do
19
+ #self.language_tags language_id = 38, grain_size = 'all', filter = ''
32
20
  end
33
21
  end
34
22
 
35
- end
23
+ end
@@ -0,0 +1,11 @@
1
+ require File.dirname(__FILE__) + '/../test_helper'
2
+
3
+ class UserTest < ActiveSupport::TestCase
4
+ context "feeds" do
5
+ setup do
6
+ @user = Factory(:user)
7
+ end
8
+ should_have_many :feed_parents
9
+ should_have_many :feeds
10
+ end
11
+ end