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.
- data/README.rdoc +21 -8
- data/Rakefile +6 -0
- data/VERSION +1 -1
- data/app/controllers/admin/{recommender → muck}/feeds_controller.rb +2 -2
- data/app/controllers/{recommender → muck}/entries_controller.rb +8 -5
- data/app/controllers/muck/feed_previews_controller.rb +33 -0
- data/app/controllers/muck/feeds_controller.rb +128 -0
- data/app/controllers/{recommender → muck}/recommendations_controller.rb +4 -1
- data/app/controllers/{recommender → muck}/search_controller.rb +3 -1
- data/app/helpers/muck_raker_feeds_helper.rb +24 -0
- data/app/models/attention.rb +13 -1
- data/app/models/click.rb +12 -0
- data/app/models/entry.rb +45 -11
- data/app/models/feed.rb +81 -7
- data/app/models/feed_parent.rb +18 -0
- data/app/models/language.rb +14 -0
- data/app/models/oai_endpoint.rb +12 -0
- data/app/models/raker_mailer.rb +16 -0
- data/app/models/recommendation.rb +13 -0
- data/app/models/service.rb +14 -0
- data/app/models/subject.rb +8 -0
- data/app/models/tag_cloud.rb +14 -1
- data/app/views/admin/feeds/index.html.erb +65 -0
- data/app/views/entries/_related_entry.html.erb +4 -0
- data/app/views/entries/_result_status.html.erb +3 -3
- data/app/views/entries/details.html.erb +19 -22
- data/app/views/entries/index.html.erb +1 -1
- data/app/views/entries/show.html.erb +4 -7
- data/app/views/feed_previews/new.html.erb +1 -0
- data/app/views/feed_previews/select_feeds.html.erb +6 -0
- data/app/views/feeds/_entry.html.erb +1 -0
- data/app/views/feeds/_feed.html.erb +9 -0
- data/app/views/feeds/index.html.erb +30 -94
- data/app/views/feeds/new.html.erb +1 -109
- data/app/views/feeds/new_extended.html.erb +1 -0
- data/app/views/feeds/show.html.erb +6 -0
- data/app/views/parts/_add_extended_feed.html.erb +31 -0
- data/app/views/parts/_add_feed.html.erb +20 -0
- data/app/views/parts/_add_single_feed.html.erb +21 -0
- data/app/views/parts/_select_feed.html.erb +4 -0
- data/app/views/raker_mailer/notification_feed_added.text.ar.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.ar.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.bg.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.bg.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.ca.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.ca.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.cs.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.cs.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.da.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.da.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.de.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.de.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.el.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.el.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.es.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.es.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.et.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.et.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.fa.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.fa.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.fi.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.fi.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.fr.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.fr.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.gl.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.gl.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.hi.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.hi.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.hr.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.hr.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.hu.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.hu.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.id.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.id.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.it.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.it.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.iw.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.iw.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.ja.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.ja.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.ko.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.ko.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.lt.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.lt.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.lv.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.lv.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.mt.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.mt.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.nl.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.nl.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.no.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.no.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.pl.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.pl.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.pt-PT.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.pt-PT.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.ro.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.ro.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.ru.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.ru.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.sk.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.sk.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.sl.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.sl.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.sq.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.sq.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.sr.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.sr.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.sv.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.sv.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.th.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.th.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.tl.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.tl.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.tr.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.tr.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.uk.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.uk.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.vi.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.vi.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.zh-CN.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.zh-CN.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.zh-TW.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.zh-TW.plain.erb +5 -0
- data/app/views/raker_mailer/notification_feed_added.text.zh.html.erb +3 -0
- data/app/views/raker_mailer/notification_feed_added.text.zh.plain.erb +5 -0
- data/app/views/recommendations/index.xml.builder +4 -4
- data/config/muck_raker_routes.rb +10 -13
- data/db/migrate/20090623181458_add_grain_size_to_entries.rb +6 -6
- data/db/migrate/20090623193525_add_grain_size_to_tag_clouds.rb +12 -0
- data/db/migrate/20090717175825_normalize_entries_subjects.rb +1 -0
- data/db/migrate/20090721043213_change_services_title_to_name.rb +9 -0
- data/db/migrate/20090721054927_remove_services_not_null_from_feeds.rb +9 -0
- data/db/migrate/20090723050510_create_feed_parents.rb +17 -0
- data/lib/active_record/acts/muck_feed_parent.rb +22 -0
- data/lib/muck_raker/muck_custom_form_builder.rb +22 -0
- data/lib/muck_raker/services.rb +6 -0
- data/lib/muck_raker/tasks.rb +8 -4
- data/lib/muck_raker.rb +7 -2
- data/locales/ar.yml +48 -15
- data/locales/bg.yml +48 -15
- data/locales/ca.yml +48 -15
- data/locales/cs.yml +48 -15
- data/locales/da.yml +48 -15
- data/locales/de.yml +48 -15
- data/locales/el.yml +48 -15
- data/locales/en.yml +46 -17
- data/locales/es.yml +48 -15
- data/locales/et.yml +48 -15
- data/locales/fa.yml +48 -15
- data/locales/fi.yml +49 -16
- data/locales/fr.yml +48 -15
- data/locales/gl.yml +48 -15
- data/locales/hi.yml +48 -15
- data/locales/hr.yml +48 -15
- data/locales/hu.yml +48 -15
- data/locales/id.yml +48 -15
- data/locales/it.yml +49 -16
- data/locales/iw.yml +48 -15
- data/locales/ja.yml +48 -15
- data/locales/ko.yml +48 -15
- data/locales/lt.yml +48 -15
- data/locales/lv.yml +48 -15
- data/locales/mt.yml +48 -15
- data/locales/nl.yml +48 -15
- data/locales/no.yml +48 -15
- data/locales/pl.yml +48 -15
- data/locales/pt-PT.yml +48 -15
- data/locales/ro.yml +48 -15
- data/locales/ru.yml +48 -15
- data/locales/sk.yml +48 -15
- data/locales/sl.yml +48 -15
- data/locales/sq.yml +48 -15
- data/locales/sr.yml +48 -15
- data/locales/sv.yml +48 -15
- data/locales/th.yml +48 -15
- data/locales/tl.yml +48 -15
- data/locales/tr.yml +48 -15
- data/locales/uk.yml +48 -15
- data/locales/vi.yml +48 -15
- data/locales/zh-CN.yml +48 -15
- data/locales/zh-TW.yml +48 -15
- data/locales/zh.yml +48 -15
- data/muck-raker.gemspec +298 -26
- data/rails/init.rb +0 -9
- data/test/rails_root/app/models/user.rb +31 -1
- data/test/rails_root/app/views/default/index.html.erb +15 -0
- data/test/rails_root/app/views/layouts/default.html.erb +38 -24
- data/test/rails_root/app/views/layouts/popup.html.erb +40 -0
- data/test/rails_root/config/database.yml +12 -11
- data/test/rails_root/config/environment.rb +4 -1
- data/test/rails_root/config/global_config.yml +3 -0
- data/test/rails_root/db/migrate/20090402234137_create_languages.rb +18 -0
- data/test/rails_root/db/migrate/20090426041056_create_countries.rb +15 -0
- data/test/rails_root/db/migrate/20090426041103_create_states.rb +18 -0
- data/test/rails_root/{migrate → db/migrate}/20090602191243_create_muck_raker.rb +0 -0
- data/test/rails_root/{migrate → db/migrate}/20090619211125_create_tag_clouds.rb +0 -0
- data/test/rails_root/db/migrate/20090623181458_add_grain_size_to_entries.rb +16 -0
- data/test/rails_root/db/migrate/20090623193525_add_grain_size_to_tag_clouds.rb +12 -0
- data/test/rails_root/{migrate → db/migrate}/20090703175825_denormalize_entries_subjects.rb +0 -0
- data/test/rails_root/db/migrate/20090716035935_change_tag_cloud_grain_sizes.rb +9 -0
- data/test/rails_root/db/migrate/20090717175825_normalize_entries_subjects.rb +18 -0
- data/test/rails_root/db/migrate/20090721043213_change_services_title_to_name.rb +9 -0
- data/test/rails_root/db/migrate/20090721054927_remove_services_not_null_from_feeds.rb +9 -0
- data/test/rails_root/db/migrate/20090723050510_create_feed_parents.rb +17 -0
- data/test/rails_root/db/schema.rb +289 -54
- data/test/rails_root/public/images/fancybox/fancy_closebox.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_left.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_progress.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_right.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_e.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_n.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_ne.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_nw.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_s.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_se.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_sw.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_w.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_title_left.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_title_main.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_title_right.png +0 -0
- data/test/rails_root/public/javascripts/jquery/jquery.easing.js +1 -0
- data/test/rails_root/public/javascripts/jquery/jquery.fancybox.js +9 -0
- data/test/rails_root/public/javascripts/muck.js +7 -3
- data/test/rails_root/public/stylesheets/application.css +1 -0
- data/test/rails_root/public/stylesheets/jquery/jquery.fancybox.css +44 -0
- data/test/rails_root/public/stylesheets/styles.css +6 -2
- data/test/rails_root/test/factories.rb +14 -1
- data/test/rails_root/test/functional/feed_previews_controller_test.rb +32 -0
- data/test/rails_root/test/functional/feeds_controller_test.rb +57 -5
- data/test/rails_root/test/shoulda_macros/controller.rb +5 -1
- data/test/rails_root/test/test_helper.rb +2 -0
- data/test/rails_root/test/unit/entry_test.rb +30 -5
- data/test/rails_root/test/unit/feed_parent_test.rb +10 -0
- data/test/rails_root/test/unit/feed_test.rb +55 -3
- data/test/rails_root/test/unit/raker_mailer_test.rb +26 -0
- data/test/rails_root/test/unit/tag_cloud_test.rb +16 -28
- data/test/rails_root/test/unit/user_test.rb +11 -0
- metadata +211 -18
- data/app/controllers/recommender/default_controller.rb +0 -15
- data/app/controllers/recommender/feeds_controller.rb +0 -64
- data/app/views/default/tour.html.erb +0 -15
- data/app/views/default/widgets.html.erb +0 -4
- 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
|
-
|
9
|
-
|
10
|
-
|
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
|
-
|
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
|
-
|
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
|
@@ -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
|
29
|
+
class EntryTest < ActiveSupport::TestCase
|
4
30
|
|
5
|
-
context "
|
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
|
@@ -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
|
15
|
+
class TagCloudTest < ActiveSupport::TestCase
|
5
16
|
|
6
|
-
context "A
|
7
|
-
|
8
|
-
|
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
|