typo 5.4.4 → 5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +59 -28
- data/MAINTAINERS +9 -17
- data/README +28 -20
- data/UPGRADE +6 -2
- data/app/controllers/accounts_controller.rb +1 -1
- data/app/controllers/admin/content_controller.rb +1 -1
- data/app/controllers/admin/feedback_controller.rb +3 -3
- data/app/controllers/admin/pages_controller.rb +2 -0
- data/app/controllers/application_controller.rb +6 -1
- data/app/controllers/articles_controller.rb +13 -1
- data/app/helpers/application_helper.rb +5 -2
- data/app/helpers/authors_helper.rb +14 -3
- data/app/models/article.rb +6 -4
- data/app/models/blog.rb +0 -4
- data/app/models/blog_sweeper.rb +1 -1
- data/app/models/content.rb +10 -5
- data/app/models/page_cache.rb +6 -7
- data/app/models/user.rb +1 -0
- data/app/views/admin/content/_form.html.erb +13 -11
- data/app/views/admin/content/_images.html.erb +1 -1
- data/app/views/admin/content/_simple_editor.html.erb +1 -0
- data/app/views/admin/content/_visual_editor.html.erb +1 -0
- data/app/views/admin/dashboard/_overview.html.erb +7 -7
- data/app/views/admin/pages/_form.html.erb +1 -0
- data/app/views/admin/pages/_images.html.erb +18 -0
- data/app/views/admin/pages/_simple_editor.html.erb +1 -2
- data/app/views/admin/pages/_visual_editor.html.erb +2 -1
- data/app/views/admin/pages/index.html.erb +1 -1
- data/app/views/admin/settings/feedback.html.erb +2 -1
- data/app/views/admin/tags/edit.html.erb +1 -1
- data/app/views/articles/_article.html.erb +17 -13
- data/app/views/articles/_article_content.html.erb +1 -0
- data/app/views/articles/_comment_box.html.erb +1 -1
- data/app/views/articles/_password_form.html.erb +10 -0
- data/app/views/articles/groupings.html.erb +1 -1
- data/app/views/articles/index.html.erb +1 -2
- data/app/views/articles/read.html.erb +1 -4
- data/app/views/articles/search.html.erb +1 -1
- data/app/views/layouts/administration.html.erb +1 -1
- data/app/views/shared/_search.html.erb +1 -1
- data/config/ckeditor.yml +14 -0
- data/config/environment.rb +13 -25
- data/config/environments/test.rb +1 -3
- data/config/filemanager.yml +16 -0
- data/config/initializers/access_rules.rb +5 -0
- data/config/routes.rb +5 -1
- data/db/migrate/004_add_sidebars.rb +3 -9
- data/db/migrate/089_drop_cache_information_table.rb +31 -0
- data/db/migrate/090_remove_keywords_from_posts.rb +9 -0
- data/db/migrate/091_adds_password_protection_to_posts.rb +9 -0
- data/doc/CACHE.SETUP.README +36 -0
- data/lang/de_DE.rb +6 -1
- data/lang/pl_PL.rb +221 -89
- data/lib/filemanager.rb +53 -0
- data/lib/filemanager/controller.rb +217 -0
- data/lib/i18n_interpolation_deprecation.rb +26 -0
- data/lib/rails_patch/active_support.rb +4 -0
- data/lib/tasks/release.rake +4 -131
- data/lib/typo_version.rb +1 -1
- data/public/.htaccess +6 -5
- data/public/filemanager/images/avi.gif +0 -0
- data/public/filemanager/images/box.gif +0 -0
- data/public/filemanager/images/bullet.gif +0 -0
- data/public/filemanager/images/close.gif +0 -0
- data/public/filemanager/images/closelabel.gif +0 -0
- data/public/filemanager/images/doc.gif +0 -0
- data/public/filemanager/images/donate-button.gif +0 -0
- data/public/filemanager/images/download-icon.gif +0 -0
- data/public/filemanager/images/folder.gif +0 -0
- data/public/filemanager/images/gif.gif +0 -0
- data/public/filemanager/images/htm.gif +0 -0
- data/public/filemanager/images/html.gif +0 -0
- data/public/filemanager/images/image-1.jpg +0 -0
- data/public/filemanager/images/image.gif +0 -0
- data/public/filemanager/images/jpg.gif +0 -0
- data/public/filemanager/images/loading.gif +0 -0
- data/public/filemanager/images/mov.gif +0 -0
- data/public/filemanager/images/nextlabel.gif +0 -0
- data/public/filemanager/images/pdf.gif +0 -0
- data/public/filemanager/images/png.gif +0 -0
- data/public/filemanager/images/ppt.gif +0 -0
- data/public/filemanager/images/prevlabel.gif +0 -0
- data/public/filemanager/images/rar.gif +0 -0
- data/public/filemanager/images/rm.gif +0 -0
- data/public/filemanager/images/rmvb.gif +0 -0
- data/public/filemanager/images/separator.gif +0 -0
- data/public/filemanager/images/spacer.gif +0 -0
- data/public/filemanager/images/swf.gif +0 -0
- data/public/filemanager/images/thumb-1.jpg +0 -0
- data/public/filemanager/images/tool_copy.gif +0 -0
- data/public/filemanager/images/tool_cut.gif +0 -0
- data/public/filemanager/images/tool_del.gif +0 -0
- data/public/filemanager/images/tool_folder.gif +0 -0
- data/public/filemanager/images/tool_imagemanager.gif +0 -0
- data/public/filemanager/images/tool_new.gif +0 -0
- data/public/filemanager/images/tool_paste.gif +0 -0
- data/public/filemanager/images/tool_props.gif +0 -0
- data/public/filemanager/images/tool_refresh.gif +0 -0
- data/public/filemanager/images/tool_unzip.gif +0 -0
- data/public/filemanager/images/tool_upload.gif +0 -0
- data/public/filemanager/images/tool_zip.gif +0 -0
- data/public/filemanager/images/txt.gif +0 -0
- data/public/filemanager/images/unknown.gif +0 -0
- data/public/filemanager/images/wmv.gif +0 -0
- data/public/filemanager/images/xls.gif +0 -0
- data/public/filemanager/images/zip.gif +0 -0
- data/public/filemanager/javascripts/filemanager.js +6 -0
- data/public/filemanager/javascripts/lang/en.js +31 -0
- data/public/filemanager/javascripts/lang/zh_CN.js +31 -0
- data/public/filemanager/javascripts/lightbox.js +497 -0
- data/public/filemanager/javascripts/translate.js +42 -0
- data/public/filemanager/resources/resources.txt +1 -0
- data/public/filemanager/stylesheets/filelist.css +147 -0
- data/public/filemanager/stylesheets/general.css +135 -0
- data/public/filemanager/stylesheets/lightbox.css +27 -0
- data/public/javascripts/prototype_ext.js +117 -0
- data/public/stylesheets/administration.css +19 -2
- data/themes/dirtylicious/views/articles/_article.html.erb +16 -12
- data/themes/dirtylicious/views/articles/_article_content.html.erb +1 -0
- data/themes/dirtylicious/views/articles/_password_form.html.erb +10 -0
- data/themes/scribbish/views/articles/_article.html.erb +18 -14
- data/themes/scribbish/views/articles/_article_content.html.erb +1 -0
- data/themes/scribbish/views/articles/_password_form.html.erb +10 -0
- data/themes/standard_issue/views/articles/_article.html.erb +16 -12
- data/themes/standard_issue/views/articles/_article_content.html.erb +1 -0
- data/themes/standard_issue/views/articles/_password_form.html.erb +10 -0
- data/themes/true-blue-3/helpers/theme_helper.rb +2 -2
- data/themes/true-blue-3/images/submit_form.jpg +0 -0
- data/themes/true-blue-3/stylesheets/style.css +27 -3
- data/themes/true-blue-3/views/articles/_article.html.erb +13 -8
- data/themes/true-blue-3/views/articles/_article_content.html.erb +1 -0
- data/themes/true-blue-3/views/articles/_comment_form.html.erb +1 -1
- data/themes/true-blue-3/views/articles/_password_form.html.erb +10 -0
- data/themes/true-blue-3/views/categories/_article.html.erb +5 -0
- data/themes/true-blue-3/views/tags/_article.html.erb +4 -0
- data/themes/typographic/views/articles/_article.html.erb +16 -12
- data/themes/typographic/views/articles/_article_content.html.erb +1 -0
- data/themes/typographic/views/articles/_password_form.html.erb +10 -0
- data/vendor/plugins/easy-ckeditor/app/controllers/ckeditor_controller.rb +2 -1
- data/vendor/plugins/easy-ckeditor/lib/ckeditor.rb +1 -20
- data/vendor/plugins/easy-ckeditor/{tasks → lib/tasks}/ckeditor_tasks.rake +0 -0
- data/vendor/plugins/filemanager/app/controllers/fm/filemanager_controller.rb +22 -0
- data/vendor/plugins/filemanager/app/views/fm/filemanager/index.html.erb +512 -0
- data/vendor/plugins/filemanager/app/views/fm/filemanager/view.html.erb +67 -0
- data/vendor/plugins/filemanager/filemanager.yml +16 -0
- data/vendor/plugins/static_sidebar/lib/static_sidebar.rb +4 -2
- data/vendor/plugins/typo_converter/{tasks → lib/tasks}/typo_converters_tasks.rake +0 -0
- data/vendor/plugins/typo_login_system/lib/access_control.rb +24 -1
- data/vendor/plugins/typo_textfilter_code/{tasks → lib/tasks}/typo_textfilter_code_tasks.rake +0 -0
- data/vendor/plugins/typo_textfilter_code/lib/typo_textfilter_code.rb +4 -3
- data/vendor/plugins/typo_textfilter_flickr/{tasks → lib/tasks}/typo_textfilter_flickr_tasks.rake +0 -0
- data/vendor/plugins/typo_textfilter_htmlfilter/{tasks → lib/tasks}/typo_textfilter_htmlfilter_tasks.rake +0 -0
- data/vendor/plugins/typo_textfilter_lightbox/{tasks → lib/tasks}/typo_textfilter_lightbox_tasks.rake +0 -0
- data/vendor/plugins/typo_textfilter_markdown/{tasks → lib/tasks}/typo_textfilter_markdown_tasks.rake +0 -0
- data/vendor/plugins/typo_textfilter_none/{tasks → lib/tasks}/typo_textfilter_none_tasks.rake +0 -0
- data/vendor/plugins/typo_textfilter_smartypants/{tasks → lib/tasks}/typo_textfilter_smartypants_tasks.rake +0 -0
- data/vendor/plugins/typo_textfilter_textile/{tasks → lib/tasks}/typo_textfilter_textile_tasks.rake +0 -0
- data/vendor/plugins/typo_textfilter_textile_and_markdown/{tasks → lib/tasks}/typo_textfilter_textile_and_markdown_tasks.rake +0 -0
- data/vendor/plugins/xml_sidebar/views/content.rhtml +1 -1
- metadata +190 -195
- data/app/controllers/admin/cache_controller.rb +0 -9
- data/app/models/cache_information.rb +0 -19
- data/db/schema.rb +0 -242
- data/doc/test_themes.rb +0 -50
- data/public/javascripts/ckeditor/config.js +0 -27
- data/spec/controllers/accounts_controller_spec.rb +0 -414
- data/spec/controllers/admin/cache_controller_spec.rb +0 -18
- data/spec/controllers/admin/categories_controller_spec.rb +0 -73
- data/spec/controllers/admin/content_controller_spec.rb +0 -443
- data/spec/controllers/admin/dashboard_controller_spec.rb +0 -13
- data/spec/controllers/admin/feedback_controller_spec.rb +0 -308
- data/spec/controllers/admin/pages_controller_spec.rb +0 -80
- data/spec/controllers/admin/profiles_controller_spec.rb +0 -22
- data/spec/controllers/admin/resources_controller_spec.rb +0 -53
- data/spec/controllers/admin/settings_controller_spec.rb +0 -80
- data/spec/controllers/admin/tags_controller_spec.rb +0 -64
- data/spec/controllers/admin/textfilters_controller_spec.rb +0 -20
- data/spec/controllers/admin/themes_controller_spec.rb +0 -30
- data/spec/controllers/admin/users_controller_spec.rb +0 -109
- data/spec/controllers/application_controller_spec.rb +0 -18
- data/spec/controllers/articles_controller_spec.rb +0 -440
- data/spec/controllers/authors_controller_spec.rb +0 -42
- data/spec/controllers/backend_controller_spec.rb +0 -337
- data/spec/controllers/categories_controller_spec.rb +0 -117
- data/spec/controllers/comments_controller_spec.rb +0 -137
- data/spec/controllers/routes/articles_routing_spec.rb +0 -31
- data/spec/controllers/routes/xml_routing_spec.rb +0 -71
- data/spec/controllers/setup_controller_spec.rb +0 -24
- data/spec/controllers/tags_controller_spec.rb +0 -147
- data/spec/controllers/textfilter_controller_spec.rb +0 -192
- data/spec/controllers/theme_controller_spec.rb +0 -39
- data/spec/controllers/xml_controller_spec.rb +0 -185
- data/spec/factories.rb +0 -69
- data/spec/helpers/application_helper_spec.rb +0 -25
- data/spec/helpers/content_helper_spec.rb +0 -28
- data/spec/lib/text_filter_plugin_spec.rb +0 -15
- data/spec/models/amazon_sidebar_spec.rb +0 -40
- data/spec/models/article_closing_spec.rb +0 -42
- data/spec/models/article_spec.rb +0 -515
- data/spec/models/blog_spec.rb +0 -116
- data/spec/models/cache_information_spec.rb +0 -42
- data/spec/models/cache_support_spec.rb +0 -51
- data/spec/models/category_spec.rb +0 -44
- data/spec/models/comment_spec.rb +0 -240
- data/spec/models/configuration_spec.rb +0 -91
- data/spec/models/content_state/feedback_states_spec.rb +0 -64
- data/spec/models/notification_spec.rb +0 -8
- data/spec/models/page_cache_spec.rb +0 -30
- data/spec/models/page_spec.rb +0 -91
- data/spec/models/ping_pinger_spec.rb +0 -33
- data/spec/models/ping_spec.rb +0 -154
- data/spec/models/redirect_spec.rb +0 -17
- data/spec/models/resource_spec.rb +0 -39
- data/spec/models/route_cache_spec.rb +0 -11
- data/spec/models/sidebar_spec.rb +0 -7
- data/spec/models/static_sidebar_spec.rb +0 -17
- data/spec/models/tag_spec.rb +0 -65
- data/spec/models/text_filter_spec.rb +0 -34
- data/spec/models/theme_spec.rb +0 -45
- data/spec/models/trackback_spec.rb +0 -60
- data/spec/models/trigger_spec.rb +0 -40
- data/spec/models/user_spec.rb +0 -198
- data/spec/rcov.opts +0 -2
- data/spec/spec.opts +0 -4
- data/spec/spec_helper.rb +0 -133
- data/spec/views/articles/index_spec.rb +0 -63
- data/spec/views/articles/read_spec.rb +0 -67
- data/spec/views/comments/html_sanitization_spec.rb +0 -119
- data/test/fixtures/blogs.yml +0 -27
- data/test/fixtures/categories.yml +0 -29
- data/test/fixtures/categorizations.yml +0 -31
- data/test/fixtures/contents.yml +0 -231
- data/test/fixtures/feedback.yml +0 -180
- data/test/fixtures/notification_mailer/article +0 -3
- data/test/fixtures/notification_mailer/comment +0 -3
- data/test/fixtures/notification_mailer/trackback +0 -3
- data/test/fixtures/notifications.yml +0 -0
- data/test/fixtures/page_caches.yml +0 -7
- data/test/fixtures/profiles.yml +0 -27
- data/test/fixtures/redirects.yml +0 -10
- data/test/fixtures/resources.yml +0 -21
- data/test/fixtures/sidebars.yml +0 -10
- data/test/fixtures/tags.yml +0 -10
- data/test/fixtures/text_filters.yml +0 -37
- data/test/fixtures/triggers.yml +0 -1
- data/test/fixtures/users.yml +0 -101
- data/test/mocks/test/dns_mock.rb +0 -13
- data/test/mocks/test/flickr_mock.rb +0 -30
- data/test/mocks/test/http_mock.rb +0 -39
- data/test/mocks/test/theme_mock.rb +0 -5
- data/test/mocks/test/xmlrpc_mock.rb +0 -28
- data/test/mocks/themes/123-numbers-in-path/about.markdown +0 -0
- data/test/mocks/themes/CamelCaseDirectory/about.markdown +0 -0
- data/test/mocks/themes/i-have-special-chars/about.markdown +0 -0
- data/test/mocks/themes/typographic/about.markdown +0 -7
- data/test/mocks/themes/typographic/images/Thumbs.db +0 -0
- data/test/mocks/themes/typographic/images/accept.png +0 -0
- data/test/mocks/themes/typographic/images/accept50.png +0 -0
- data/test/mocks/themes/typographic/images/bg_body.jpg +0 -0
- data/test/mocks/themes/typographic/images/bg_white.png +0 -0
- data/test/mocks/themes/typographic/images/bg_wrapper.jpg +0 -0
- data/test/mocks/themes/typographic/images/bullet_bottom.png +0 -0
- data/test/mocks/themes/typographic/images/bullet_right.png +0 -0
- data/test/mocks/themes/typographic/images/email_open.png +0 -0
- data/test/mocks/themes/typographic/images/email_open50.png +0 -0
- data/test/mocks/themes/typographic/images/meta.png +0 -0
- data/test/mocks/themes/typographic/images/page_edit.png +0 -0
- data/test/mocks/themes/typographic/images/page_edit50.png +0 -0
- data/test/mocks/themes/typographic/images/tag.png +0 -0
- data/test/mocks/themes/typographic/images/user.png +0 -0
- data/test/mocks/themes/typographic/images/user50.png +0 -0
- data/test/mocks/themes/typographic/images/world_link.png +0 -0
- data/test/mocks/themes/typographic/images/world_link50.png +0 -0
- data/test/mocks/themes/typographic/layouts/default.html.erb +0 -42
- data/test/mocks/themes/typographic/preview.png +0 -0
- data/test/mocks/themes/typographic/stylesheets/colors.css +0 -51
- data/test/mocks/themes/typographic/stylesheets/layout.css +0 -346
- data/test/mocks/themes/typographic/stylesheets/reset.css +0 -5
- data/test/mocks/themes/typographic/stylesheets/style.css +0 -36
- data/test/mocks/themes/typographic/views/articles/_article.html.erb +0 -41
- data/test/mocks/themes/typographic/views/articles/_comment.html.erb +0 -14
- data/test/mocks/themes/typographic/views/articles/_comment_form.html.erb +0 -48
- data/test/mocks/themes/typographic/views/articles/_comment_list.html.erb +0 -7
- data/test/mocks/themes/typographic/views/articles/_trackback.html.erb +0 -9
- data/test/mocks/themes/typographic/views/articles/comment_preview.html.erb +0 -10
- data/test/mocks/themes/typographic/views/articles/index.html.erb +0 -5
- data/test/mocks/themes/typographic/views/articles/read.html.erb +0 -42
- data/test/mocks/themes/typographic/views/shared/_search.html.erb +0 -17
- data/test/mocks/themes/typographic/views/theme/static_view_test.html.erb +0 -1
- data/test/test_helper.rb +0 -13
- data/themes/true-blue-3/images/frederic-de-villamil.jpg +0 -0
- data/themes/true-blue-3/images/textarea_bg.jpg +0 -0
@@ -1,39 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe ThemeController do
|
4
|
-
integrate_views
|
5
|
-
|
6
|
-
it "test_stylesheets" do
|
7
|
-
get :stylesheets, :filename => "style.css"
|
8
|
-
assert_response :success
|
9
|
-
assert_equal "text/css", @response.content_type
|
10
|
-
assert_equal "utf-8", @response.charset
|
11
|
-
assert_equal "inline; filename=\"style.css\"", @response.headers['Content-Disposition']
|
12
|
-
end
|
13
|
-
|
14
|
-
it "test_images" do
|
15
|
-
get :images, :filename => "bg_white.png"
|
16
|
-
assert_response :success
|
17
|
-
assert_equal "image/png", @response.content_type
|
18
|
-
assert_equal "inline; filename=\"bg_white.png\"", @response.headers['Content-Disposition']
|
19
|
-
end
|
20
|
-
|
21
|
-
it "test_malicious_path" do
|
22
|
-
get :stylesheets, :filename => "../../../config/database.yml"
|
23
|
-
assert_response 404
|
24
|
-
end
|
25
|
-
|
26
|
-
it "test_view_theming" do
|
27
|
-
get :static_view_test
|
28
|
-
assert_response :success
|
29
|
-
|
30
|
-
assert @response.body =~ /Static View Test from typographic/
|
31
|
-
end
|
32
|
-
|
33
|
-
def disabled_test_javascript
|
34
|
-
get :stylesheets, :filename => "typo.js"
|
35
|
-
assert_response :success
|
36
|
-
assert_equal "text/javascript", @response.content_type
|
37
|
-
assert_equal "inline; filename=\"typo.js\"", @response.headers['Content-Disposition']
|
38
|
-
end
|
39
|
-
end
|
@@ -1,185 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
require 'dns_mock'
|
3
|
-
|
4
|
-
describe XmlController do
|
5
|
-
integrate_views
|
6
|
-
|
7
|
-
def assert_select(*args, &block)
|
8
|
-
@html_document ||= HTML::Document.new(@response.body, false, true)
|
9
|
-
super(*args,&block)
|
10
|
-
end
|
11
|
-
|
12
|
-
before do
|
13
|
-
@article = Factory.create(:article)
|
14
|
-
end
|
15
|
-
|
16
|
-
def assert_moved_permanently_to(location)
|
17
|
-
assert_response :moved_permanently
|
18
|
-
assert_equal location, @response.headers["Location"]
|
19
|
-
end
|
20
|
-
|
21
|
-
describe "without format parameter" do
|
22
|
-
it "redirects main feed to articles RSS feed" do
|
23
|
-
get :feed, :type => 'feed'
|
24
|
-
assert_moved_permanently_to 'http://test.host/articles.rss'
|
25
|
-
end
|
26
|
-
|
27
|
-
it "redirects comments feed to Comments RSS feed" do
|
28
|
-
get :feed, :type => 'comments'
|
29
|
-
assert_moved_permanently_to admin_comments_url(:format=>:rss)
|
30
|
-
end
|
31
|
-
|
32
|
-
it "returns valid RSS feed for trackbacks feed type" do
|
33
|
-
get :feed, :type => 'trackbacks'
|
34
|
-
assert_response :success
|
35
|
-
assert_xml @response.body
|
36
|
-
assert_feedvalidator @response.body
|
37
|
-
assert_rss20
|
38
|
-
end
|
39
|
-
|
40
|
-
it "redirects article feed to Article RSS feed" do
|
41
|
-
get :feed, :type => 'article', :id => @article.id
|
42
|
-
assert_moved_permanently_to @article.permalink_by_format(:rss)
|
43
|
-
end
|
44
|
-
|
45
|
-
it "redirects category feed to Category RSS feed" do
|
46
|
-
get :feed, :type => 'category', :id => 'personal'
|
47
|
-
assert_moved_permanently_to(category_url('personal', :format => 'rss'))
|
48
|
-
end
|
49
|
-
|
50
|
-
it "redirects tag feed to Tag RSS feed" do
|
51
|
-
get :feed, :type => 'tag', :id => 'foo'
|
52
|
-
assert_moved_permanently_to(tag_url('foo', :format=>'rss'))
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
it "test_feed_rss20" do
|
57
|
-
get :feed, :format => 'rss20', :type => 'feed'
|
58
|
-
assert_moved_permanently_to 'http://test.host/articles.rss'
|
59
|
-
end
|
60
|
-
|
61
|
-
it "test_feed_rss20_comments" do
|
62
|
-
get :feed, :format => 'rss20', :type => 'comments'
|
63
|
-
assert_moved_permanently_to admin_comments_url(:format=>:rss)
|
64
|
-
end
|
65
|
-
|
66
|
-
it "test_feed_rss20_trackbacks" do
|
67
|
-
get :feed, :format => 'rss20', :type => 'trackbacks'
|
68
|
-
assert_response :success
|
69
|
-
assert_xml @response.body
|
70
|
-
assert_feedvalidator @response.body
|
71
|
-
assert_rss20
|
72
|
-
end
|
73
|
-
|
74
|
-
it "test_feed_rss20_article" do
|
75
|
-
get :feed, :format => 'rss20', :type => 'article', :id => @article.id
|
76
|
-
assert_moved_permanently_to @article.permalink_by_format(:rss)
|
77
|
-
end
|
78
|
-
|
79
|
-
it "test_feed_rss20_category" do
|
80
|
-
get :feed, :format => 'rss20', :type => 'category', :id => 'personal'
|
81
|
-
assert_moved_permanently_to(category_url('personal', :format => 'rss'))
|
82
|
-
end
|
83
|
-
|
84
|
-
it "test_feed_rss20_tag" do
|
85
|
-
get :feed, :format => 'rss20', :type => 'tag', :id => 'foo'
|
86
|
-
assert_moved_permanently_to(tag_url('foo', :format=>'rss'))
|
87
|
-
end
|
88
|
-
|
89
|
-
it "test_feed_atom10_feed" do
|
90
|
-
get :feed, :format => 'atom10', :type => 'feed'
|
91
|
-
assert_response :moved_permanently
|
92
|
-
assert_moved_permanently_to "http://test.host/articles.atom"
|
93
|
-
end
|
94
|
-
|
95
|
-
it "test_feed_atom10_comments" do
|
96
|
-
get :feed, :format => 'atom10', :type => 'comments'
|
97
|
-
assert_response :moved_permanently
|
98
|
-
assert_moved_permanently_to admin_comments_url(:format=>'atom')
|
99
|
-
end
|
100
|
-
|
101
|
-
it "test_feed_atom10_trackbacks" do
|
102
|
-
get :feed, :format => 'atom10', :type => 'trackbacks'
|
103
|
-
assert_response :success
|
104
|
-
assert_xml @response.body
|
105
|
-
assert_feedvalidator @response.body
|
106
|
-
|
107
|
-
assert_equal(assigns(:items).sort { |a, b| b.created_at <=> a.created_at },
|
108
|
-
assigns(:items))
|
109
|
-
|
110
|
-
assert_atom10
|
111
|
-
|
112
|
-
assert_select 'title[type=html]'
|
113
|
-
assert_select 'summary'
|
114
|
-
end
|
115
|
-
|
116
|
-
it "test_feed_atom10_article" do
|
117
|
-
get :feed, :format => 'atom10', :type => 'article', :id => @article.id
|
118
|
-
assert_moved_permanently_to @article.permalink_by_format('atom')
|
119
|
-
end
|
120
|
-
|
121
|
-
it "test_feed_atom10_category" do
|
122
|
-
get :feed, :format => 'atom10', :type => 'category', :id => 'personal'
|
123
|
-
assert_moved_permanently_to(category_url('personal', :format => 'atom'))
|
124
|
-
end
|
125
|
-
|
126
|
-
it "test_feed_atom10_tag" do
|
127
|
-
get :feed, :format => 'atom10', :type => 'tag', :id => 'foo'
|
128
|
-
assert_moved_permanently_to(tag_url('foo',:format => 'atom'))
|
129
|
-
end
|
130
|
-
|
131
|
-
it "test_articlerss" do
|
132
|
-
get :articlerss, :id => @article.id
|
133
|
-
assert_response :redirect
|
134
|
-
end
|
135
|
-
|
136
|
-
it "test_commentrss" do
|
137
|
-
get :commentrss, :id => 1
|
138
|
-
assert_response :redirect
|
139
|
-
end
|
140
|
-
|
141
|
-
it "test_trackbackrss" do
|
142
|
-
get :trackbackrss, :id => 1
|
143
|
-
assert_response :redirect
|
144
|
-
end
|
145
|
-
|
146
|
-
it "test_bad_format" do
|
147
|
-
get :feed, :format => 'atom04', :type => 'feed'
|
148
|
-
assert_response :missing
|
149
|
-
end
|
150
|
-
|
151
|
-
it "test_bad_type" do
|
152
|
-
get :feed, :format => 'rss20', :type => 'foobar'
|
153
|
-
assert_response :missing
|
154
|
-
end
|
155
|
-
|
156
|
-
it "test_rsd" do
|
157
|
-
get :rsd, :id => 1
|
158
|
-
assert_response :success
|
159
|
-
assert_nothing_raised do
|
160
|
-
assert REXML::Document.new(@response.body)
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
it "test_atom03" do
|
165
|
-
get :feed, :format => 'atom03', :type => 'feed'
|
166
|
-
assert_response :moved_permanently
|
167
|
-
assert_moved_permanently_to 'http://test.host/articles.atom'
|
168
|
-
end
|
169
|
-
|
170
|
-
# TODO(laird): make this more robust
|
171
|
-
it "test_sitemap" do
|
172
|
-
get :feed, :format => 'googlesitemap', :type => 'sitemap'
|
173
|
-
|
174
|
-
assert_response :success
|
175
|
-
assert_xml @response.body
|
176
|
-
end
|
177
|
-
|
178
|
-
def assert_rss20
|
179
|
-
assert_select 'rss:root[version=2.0] > channel item', :count => assigns(:items).size
|
180
|
-
end
|
181
|
-
|
182
|
-
def assert_atom10
|
183
|
-
assert_select 'feed:root[xmlns="http://www.w3.org/2005/Atom"] > entry', :count => assigns(:items).size
|
184
|
-
end
|
185
|
-
end
|
data/spec/factories.rb
DELETED
@@ -1,69 +0,0 @@
|
|
1
|
-
require 'factory_girl'
|
2
|
-
|
3
|
-
Factory.sequence :user do |n|
|
4
|
-
"user#{n}"
|
5
|
-
end
|
6
|
-
|
7
|
-
Factory.sequence :guid do |n|
|
8
|
-
"deadbeef#{n}"
|
9
|
-
end
|
10
|
-
|
11
|
-
Factory.define :user do |u|
|
12
|
-
u.login { Factory.next(:user) }
|
13
|
-
u.email 'some.where@out.there'
|
14
|
-
u.notify_via_email false
|
15
|
-
u.notify_on_new_articles false
|
16
|
-
u.notify_watch_my_articles false
|
17
|
-
u.notify_on_comments false
|
18
|
-
u.password 'top-secret'
|
19
|
-
end
|
20
|
-
|
21
|
-
Factory.define :article do |a|
|
22
|
-
a.title 'A big article'
|
23
|
-
a.body 'A content with several data'
|
24
|
-
a.guid { Factory.next(:guid) }
|
25
|
-
a.permalink 'a-big-article'
|
26
|
-
a.published_at Time.now
|
27
|
-
# Using an existing user avoids the password reminder mail overhead
|
28
|
-
a.user { User.find(:first) }
|
29
|
-
#a.association :user, :factory => :user
|
30
|
-
end
|
31
|
-
|
32
|
-
Factory.define :second_article, :parent => :article do |a|
|
33
|
-
a.title 'Another big article'
|
34
|
-
a.published_at Time.now - 2.seconds
|
35
|
-
end
|
36
|
-
|
37
|
-
Factory.define :article_with_accent_in_html, :parent => :article do |a|
|
38
|
-
a.title 'article with accent'
|
39
|
-
a.body 'écoute The future is cool!'
|
40
|
-
a.permalink 'article-with-accent'
|
41
|
-
a.published_at Time.now - 2.seconds
|
42
|
-
end
|
43
|
-
|
44
|
-
Factory.define :blog do |b|
|
45
|
-
b.base_url 'http://myblog.net'
|
46
|
-
b.blog_name 'test blog'
|
47
|
-
end
|
48
|
-
|
49
|
-
Factory.define :profile_admin, :class => :profile do |l|
|
50
|
-
l.label 'admin'
|
51
|
-
l.nicename 'Typo administrator'
|
52
|
-
l.modules [:dashboard, :write, :content, :feedback, :themes, :sidebar, :users, :settings, :profile]
|
53
|
-
end
|
54
|
-
Factory.define :profile_publisher, :class => :profile do |l|
|
55
|
-
l.label 'published'
|
56
|
-
l.nicename 'Blog publisher'
|
57
|
-
l.modules [:dashboard, :write, :content, :feedback, :profile]
|
58
|
-
end
|
59
|
-
Factory.define :profile_contributor, :class => :profile do |l|
|
60
|
-
l.label 'contributor'
|
61
|
-
l.nicename 'Contributor'
|
62
|
-
l.modules [:dashboard, :profile]
|
63
|
-
end
|
64
|
-
|
65
|
-
Factory.define :category do |c|
|
66
|
-
c.name 'SoftwareFactory'
|
67
|
-
c.permalink 'softwarefactory'
|
68
|
-
c.position 1
|
69
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
|
3
|
-
describe ApplicationHelper do
|
4
|
-
|
5
|
-
helper_name 'application'
|
6
|
-
|
7
|
-
describe '#render_flash' do
|
8
|
-
it 'should render empty string if no flash' do
|
9
|
-
render_flash.should == ''
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'should render a good render if only one notice' do
|
13
|
-
flash[:notice] = 'good update'
|
14
|
-
render_flash.should == '<span class="notice">good update</span>'
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'should render the notice and error flash' do
|
18
|
-
flash[:notice] = 'good update'
|
19
|
-
flash[:error] = "it's not good"
|
20
|
-
render_flash.split("<br />\n").sort.should == ['<span class="error">it\'s not good</span>','<span class="notice">good update</span>']
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe ContentHelper, 'calc_distributed_class' do
|
4
|
-
include ContentHelper
|
5
|
-
|
6
|
-
it 'should behave as specified in the old test_calc_distributed_class_basic ' do
|
7
|
-
calc_distributed_class(0, 0, "prefix", 5, 15).should == 'prefix5'
|
8
|
-
|
9
|
-
(0..10).each do |article|
|
10
|
-
calc_distributed_class(article, 10, "prefix", 0, 10).should == "prefix#{article}"
|
11
|
-
end
|
12
|
-
|
13
|
-
(0..20).each do |article|
|
14
|
-
calc_distributed_class(article, 20, "prefix", 0, 10).should == "prefix#{(article/2).to_i}"
|
15
|
-
end
|
16
|
-
|
17
|
-
(0..5).each do |article|
|
18
|
-
calc_distributed_class(article, 5, "prefix", 0, 10).should == "prefix#{(article*2).to_i}"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should behave like the old test_calc_distributed_class_offset" do
|
23
|
-
(0..10).each do |article|
|
24
|
-
calc_distributed_class(article, 10, "prefix", 6, 16).should == "prefix#{article+6}"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe TextFilterPlugin::Macro do
|
4
|
-
|
5
|
-
describe "#self.attributes_parse" do
|
6
|
-
it 'should parse lang="ruby" to {"lang" => "ruby"}' do
|
7
|
-
TextFilterPlugin::Macro.attributes_parse('<typo:code lang="ruby">').should == {'lang' => 'ruby'}
|
8
|
-
end
|
9
|
-
|
10
|
-
it "should parse lang='ruby' to {'lang' => 'ruby'}" do
|
11
|
-
TextFilterPlugin::Macro.attributes_parse("<typo:code lang='ruby'>").should == {'lang' => 'ruby'}
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
2
|
-
|
3
|
-
describe "Given a brand new AmazonSidebar" do
|
4
|
-
before(:each) do
|
5
|
-
@sidebar = AmazonSidebar.new
|
6
|
-
end
|
7
|
-
|
8
|
-
it "title should be 'Cited books'" do
|
9
|
-
@sidebar.title.should == 'Cited books'
|
10
|
-
end
|
11
|
-
|
12
|
-
it "associate_id should be 'justasummary-20'" do
|
13
|
-
@sidebar.associate_id.should == 'justasummary-20'
|
14
|
-
end
|
15
|
-
|
16
|
-
it "maxlinks should be 4" do
|
17
|
-
@sidebar.maxlinks.should == 4
|
18
|
-
end
|
19
|
-
|
20
|
-
it "description should be 'Adds sidebar links...'" do
|
21
|
-
@sidebar.description.should ==
|
22
|
-
"Adds sidebar links to any amazon books linked in the body of the page"
|
23
|
-
end
|
24
|
-
|
25
|
-
it "sidebar should be valid" do
|
26
|
-
@sidebar.should be_valid
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
describe "With no amazon sidebars" do
|
31
|
-
it "hash initialization should set attributes correctly" do
|
32
|
-
sb = AmazonSidebar.new(:title => 'Books',
|
33
|
-
:associate_id => 'justasummary-21',
|
34
|
-
:maxlinks => 3)
|
35
|
-
sb.should be_valid
|
36
|
-
sb.title.should == 'Books'
|
37
|
-
sb.associate_id.should == 'justasummary-21'
|
38
|
-
sb.maxlinks.should == 3
|
39
|
-
end
|
40
|
-
end
|
@@ -1,42 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + "/../spec_helper"
|
2
|
-
|
3
|
-
describe "CommentClosing from Test::Unit; no I don't know why it's in article_closing_spec.rb" do
|
4
|
-
def an_article(options = {})
|
5
|
-
Article.create(options.reverse_merge(:user_id => 1, :body => 'Foo', :title => 'Bar'))
|
6
|
-
end
|
7
|
-
|
8
|
-
before(:each) do
|
9
|
-
@blog = blogs(:default)
|
10
|
-
@blog.sp_article_auto_close = 0
|
11
|
-
@blog.default_allow_comments = true
|
12
|
-
|
13
|
-
# Blog.default may have already cached a copy of the default blog, and
|
14
|
-
# it won't see our changes. So override the caching.
|
15
|
-
Blog.stub!(:default).and_return(@blog)
|
16
|
-
end
|
17
|
-
|
18
|
-
it "test_new_article_should_be_open_if_auto_close_is_zero" do
|
19
|
-
art = an_article
|
20
|
-
art.created_at = Time.now
|
21
|
-
assert !art.comments_closed?
|
22
|
-
end
|
23
|
-
|
24
|
-
it "test_old_article_should_be_open_if_auto_close_is_zero" do
|
25
|
-
art = an_article(:created_at => Time.now - 1000.days)
|
26
|
-
assert !art.comments_closed?
|
27
|
-
end
|
28
|
-
|
29
|
-
it "test_new_article_should_be_open_if_auto_close_is_thirty" do
|
30
|
-
@blog.sp_article_auto_close = 30
|
31
|
-
art = an_article
|
32
|
-
assert !art.comments_closed?
|
33
|
-
art.created_at = Time.now - 29.days
|
34
|
-
assert !art.comments_closed?
|
35
|
-
end
|
36
|
-
|
37
|
-
it "test_old_article_should_be_closed_if_auto_close_is_thirty" do
|
38
|
-
@blog.sp_article_auto_close = 30
|
39
|
-
art = an_article(:created_at => Time.now - 31.days)
|
40
|
-
assert art.comments_closed?
|
41
|
-
end
|
42
|
-
end
|