typo 5.4.4 → 5.5
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.
- 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,137 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
|
-
|
|
3
|
-
describe "All Requests", :shared => true do
|
|
4
|
-
before do
|
|
5
|
-
@comment = mock_model(Comment,
|
|
6
|
-
:save => true,
|
|
7
|
-
:author => 'bob',
|
|
8
|
-
:email => 'bob@home',
|
|
9
|
-
:url => 'http://bobs.home/')
|
|
10
|
-
@article = contents(:article1)
|
|
11
|
-
@blog = blogs(:default)
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
describe "General Comment Creation", :shared => true do
|
|
16
|
-
it_should_behave_like "All Requests"
|
|
17
|
-
|
|
18
|
-
it "should assign the new comment to @comment" do
|
|
19
|
-
make_the_request
|
|
20
|
-
assigns[:comment].should == Comment.find_by_author_and_body_and_article_id('bob', 'content', contents(:article1).id)
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it "should assign the article to @article" do
|
|
24
|
-
make_the_request
|
|
25
|
-
assigns[:article].should == @article
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it "should save the comment" do
|
|
29
|
-
lambda do
|
|
30
|
-
make_the_request
|
|
31
|
-
end.should change(Comment, :count).by(1)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
it "should set the author" do
|
|
35
|
-
make_the_request
|
|
36
|
-
contents(:article1).comments.last.author.should == 'bob'
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
it "should set an author cookie" do
|
|
40
|
-
make_the_request
|
|
41
|
-
cookies["author"].should == 'bob'
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
it "should set a gravatar_id cookie" do
|
|
45
|
-
make_the_request(:body => 'content', :author => 'bob',
|
|
46
|
-
:email => 'bob@home', :url => 'http://bobs.home/')
|
|
47
|
-
cookies["gravatar_id"].should == Digest::MD5.hexdigest('bob@home')
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
it "should set a url cookie" do
|
|
51
|
-
make_the_request(:body => 'content', :author => 'bob',
|
|
52
|
-
:email => 'bob@home', :url => 'http://bobs.home/')
|
|
53
|
-
cookies["url"].should == 'http://bobs.home/'
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
it "should create a comment" do
|
|
57
|
-
make_the_request
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
describe CommentsController, 'create' do
|
|
63
|
-
it_should_behave_like "General Comment Creation"
|
|
64
|
-
|
|
65
|
-
def make_the_request(comment = {:body => 'content', :author => 'bob'})
|
|
66
|
-
post :create, :comment => comment, :article_id => contents(:article1).id
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
it "should redirect to the article" do
|
|
70
|
-
make_the_request
|
|
71
|
-
response.should redirect_to("#{blogs(:default).base_url}/#{contents(:article1).created_at.year}/#{sprintf("%.2d", contents(:article1).created_at.month)}/#{sprintf("%.2d", contents(:article1).created_at.day)}/#{contents(:article1).permalink}")
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
describe CommentsController, 'AJAX creation' do
|
|
76
|
-
it_should_behave_like "General Comment Creation"
|
|
77
|
-
|
|
78
|
-
def make_the_request(comment = {:body => 'content', :author => 'bob'})
|
|
79
|
-
xhr :post, :create, :comment => comment, :article_id => contents(:article1).id
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
it "should render the comment partial" do
|
|
83
|
-
make_the_request
|
|
84
|
-
response.should render_template("/articles/_comment")
|
|
85
|
-
end
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
describe CommentsController, 'scoped index' do
|
|
89
|
-
it_should_behave_like "All Requests"
|
|
90
|
-
|
|
91
|
-
it "GET 2007/10/11/slug/comments should redirect to /2007/10/11/slug#comments" do
|
|
92
|
-
#content(:article1) => Time.now - 2 days
|
|
93
|
-
get 'index', :article_id => @article.id
|
|
94
|
-
response.should redirect_to("#{blogs(:default).base_url}/#{contents(:article1).created_at.year}/#{sprintf("%.2d", contents(:article1).created_at.month)}/#{sprintf("%.2d", contents(:article1).created_at.day)}/#{contents(:article1).permalink}#comments")
|
|
95
|
-
end
|
|
96
|
-
|
|
97
|
-
it "GET /2007/10/11/slug/comments.atom should return an atom feed" do
|
|
98
|
-
get :index, :format => 'atom', :article_id => contents(:article1).id
|
|
99
|
-
response.should be_success
|
|
100
|
-
response.should render_template("articles/_atom_feed")
|
|
101
|
-
end
|
|
102
|
-
|
|
103
|
-
it "GET /2007/10/11/slug/comments.rss should return an rss feed" do
|
|
104
|
-
get :index, :format => 'rss', :article_id => contents(:article1).id
|
|
105
|
-
response.should be_success
|
|
106
|
-
response.should render_template("articles/_rss20_feed")
|
|
107
|
-
end
|
|
108
|
-
end
|
|
109
|
-
|
|
110
|
-
describe CommentsController, 'GET /comments' do
|
|
111
|
-
it "should be successful" do
|
|
112
|
-
get 'index'
|
|
113
|
-
response.should be_success
|
|
114
|
-
end
|
|
115
|
-
|
|
116
|
-
it "should not bother fetching any comments " do
|
|
117
|
-
mock_comment = mock(Comment)
|
|
118
|
-
mock_comment.should_not_receive(:published_comments)
|
|
119
|
-
mock_comment.should_not_receive(:rss_limit_params)
|
|
120
|
-
|
|
121
|
-
get 'index'
|
|
122
|
-
end
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
describe CommentsController, "GET /comments.:format" do
|
|
126
|
-
it ":format => 'atom' should return an atom feed" do
|
|
127
|
-
get 'index', :format => 'atom'
|
|
128
|
-
response.should be_success
|
|
129
|
-
response.should render_template("articles/_atom_feed")
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
it ":format => 'rss' should return an rss feed"do
|
|
133
|
-
get 'index', :format => 'rss'
|
|
134
|
-
response.should be_success
|
|
135
|
-
response.should render_template("articles/_rss20_feed")
|
|
136
|
-
end
|
|
137
|
-
end
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
2
|
-
|
|
3
|
-
describe ArticlesController do
|
|
4
|
-
describe "route generation" do
|
|
5
|
-
it "should map #index" do
|
|
6
|
-
route_for(:controller => "articles", :action => "index").should == "/"
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
it "should map #index with rss format" do
|
|
10
|
-
route_for(:controller => "articles", :action => "index", :format => "rss").should == "/articles.rss"
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it "should map #index with atom format" do
|
|
14
|
-
route_for(:controller => "articles", :action => "index", :format => "atom").should == "/articles.atom"
|
|
15
|
-
end
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
describe "route recognition" do
|
|
19
|
-
it "should generate params for #index" do
|
|
20
|
-
params_from(:get, "/").should == {:controller => "articles", :action => "index"}
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
it "should generate params for #index with rss format" do
|
|
24
|
-
params_from(:get, "/articles.rss").should == {:controller => "articles", :action => "index", :format => "rss"}
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
it "should generate params for #index with atom format" do
|
|
28
|
-
params_from(:get, "/articles.atom").should == {:controller => "articles", :action => "index", :format => "atom"}
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
|
|
2
|
-
|
|
3
|
-
describe XmlController do
|
|
4
|
-
describe "route generation" do
|
|
5
|
-
it "should map #articlerss" do
|
|
6
|
-
route_for(:controller => "xml", :action => "articlerss", :id => "1").should == "/xml/articlerss/1/feed.xml"
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
it "should map #commentrss" do
|
|
10
|
-
route_for(:controller => "xml", :action => "commentrss").should == "/xml/commentrss/feed.xml"
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
it "should map #trackbackrss" do
|
|
14
|
-
route_for(:controller => "xml", :action => "trackbackrss").should == "/xml/trackbackrss/feed.xml"
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it "should map #feed" do
|
|
18
|
-
route_for(:controller => "xml", :action => "feed", :type => "feed", :format => "atom").should == "/xml/atom/feed.xml"
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
it "should map #feed with a custom type" do
|
|
22
|
-
route_for(:controller => "xml", :action => "feed", :format => "atom", :type => "comments").should == "/xml/atom/comments/feed.xml"
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
it "should map #feed with a custom type and an id" do
|
|
26
|
-
route_for(:controller => "xml", :action => "feed", :format => "atom", :type => "comments", :id => "1").should == "/xml/atom/comments/1/feed.xml"
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
it "should map #feed with rss type" do
|
|
30
|
-
route_for(:controller => "xml", :action => "feed", :type => "feed", :format => "rss").should == "/xml/rss"
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it "should map #feed with sitemap type" do
|
|
34
|
-
route_for(:controller => "xml", :action => "feed", :type => "sitemap", :format => "googlesitemap").should == "/sitemap.xml"
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
describe "route recognition" do
|
|
39
|
-
it "should generate params for #articlerss" do
|
|
40
|
-
params_from(:get, "/xml/articlerss/1/feed.xml").should == {:controller => "xml", :action => "articlerss", :id => "1"}
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
it "should generate params for #commentrss" do
|
|
44
|
-
params_from(:get, "/xml/commentrss/feed.xml").should == {:controller => "xml", :action => "commentrss"}
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
it "should generate params for #trackbackrss" do
|
|
48
|
-
params_from(:get, "/xml/trackbackrss/feed.xml").should == {:controller => "xml", :action => "trackbackrss"}
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
it "should generate params for #feed" do
|
|
52
|
-
params_from(:get, "/xml/atom/feed.xml").should == {:controller => "xml", :action => "feed", :type => "feed", :format => "atom"}
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
it "should generate params for #feed with a custom type" do
|
|
56
|
-
params_from(:get, "/xml/atom/comments/feed.xml").should == {:controller => "xml", :action => "feed", :format => "atom", :type => "comments"}
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
it "should generate params for #feed with a custom type and an id" do
|
|
60
|
-
params_from(:get, "/xml/atom/comments/1/feed.xml").should == {:controller => "xml", :action => "feed", :format => "atom", :type => "comments", :id => "1"}
|
|
61
|
-
end
|
|
62
|
-
|
|
63
|
-
it "should generate params for #feed with rss type" do
|
|
64
|
-
params_from(:get, "/xml/rss").should == {:controller => "xml", :action => "feed", :type => "feed", :format => "rss"}
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
it "should generate params for #feed with sitemap type" do
|
|
68
|
-
params_from(:get, "/sitemap.xml").should == {:controller => "xml", :action => "feed", :type => "sitemap", :format => "googlesitemap"}
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
end
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
|
-
|
|
3
|
-
describe 'GET setup with no configured blog' do
|
|
4
|
-
controller_name :setup
|
|
5
|
-
|
|
6
|
-
before(:each) do
|
|
7
|
-
Blog.delete_all
|
|
8
|
-
@blog = Blog.new.save
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
it 'renders index' do
|
|
12
|
-
get 'index'
|
|
13
|
-
response.should render_template('index')
|
|
14
|
-
end
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
describe 'GET setup with a configured blog and some users' do
|
|
18
|
-
controller_name :setup
|
|
19
|
-
|
|
20
|
-
it 'redirects to login' do
|
|
21
|
-
get 'index'
|
|
22
|
-
response.should redirect_to(:controller => 'articles', :action => 'index')
|
|
23
|
-
end
|
|
24
|
-
end
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
|
-
|
|
3
|
-
describe TagsController, "/index" do
|
|
4
|
-
before(:each) do
|
|
5
|
-
Tag.stub!(:find_all_with_article_counters) \
|
|
6
|
-
.and_return(mock('tags', :null_object => true))
|
|
7
|
-
|
|
8
|
-
this_blog = Blog.default
|
|
9
|
-
controller.stub!(:this_blog) \
|
|
10
|
-
.and_return(this_blog)
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def do_get
|
|
14
|
-
get 'index'
|
|
15
|
-
end
|
|
16
|
-
|
|
17
|
-
it "should be successful" do
|
|
18
|
-
do_get
|
|
19
|
-
response.should be_success
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
it "should render :index"
|
|
23
|
-
if false
|
|
24
|
-
controller.stub!(:template_exists?) \
|
|
25
|
-
.and_return(true)
|
|
26
|
-
|
|
27
|
-
do_get
|
|
28
|
-
response.should render_template(:index)
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
it "should fall back to articles/groupings" do
|
|
32
|
-
controller.should_receive(:template_exists?) \
|
|
33
|
-
.with() \
|
|
34
|
-
.and_return(false)
|
|
35
|
-
do_get
|
|
36
|
-
response.should render_template('articles/groupings')
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
describe TagsController, '/articles/tag/foo' do
|
|
41
|
-
before(:each) do
|
|
42
|
-
@tag = mock('tag', :null_object => true)
|
|
43
|
-
@tag.stub!(:empty?) \
|
|
44
|
-
.and_return(false)
|
|
45
|
-
@tag.stub!(:name).and_return('foo')
|
|
46
|
-
|
|
47
|
-
Tag.stub!(:find_by_permalink) \
|
|
48
|
-
.and_return(@tag)
|
|
49
|
-
|
|
50
|
-
this_blog = Blog.default
|
|
51
|
-
controller.stub!(:this_blog) \
|
|
52
|
-
.and_return(this_blog)
|
|
53
|
-
end
|
|
54
|
-
|
|
55
|
-
def do_get
|
|
56
|
-
get 'show', :id => 'foo'
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
it 'should be successful' do
|
|
60
|
-
do_get()
|
|
61
|
-
response.should be_success
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
it 'should call Tag.find_by_permalink' do
|
|
65
|
-
Tag.should_receive(:find_by_permalink) \
|
|
66
|
-
.with('foo') \
|
|
67
|
-
.and_raise(ActiveRecord::RecordNotFound)
|
|
68
|
-
lambda do
|
|
69
|
-
do_get
|
|
70
|
-
end.should raise_error(ActiveRecord::RecordNotFound)
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
it 'should render :show by default'
|
|
74
|
-
if false
|
|
75
|
-
controller.stub!(:template_exists?) \
|
|
76
|
-
.and_return(true)
|
|
77
|
-
do_get
|
|
78
|
-
response.should render_template(:show)
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
it 'should fall back to rendering articles/index' do
|
|
82
|
-
controller.should_receive(:template_exists?) \
|
|
83
|
-
.with() \
|
|
84
|
-
.and_return(false)
|
|
85
|
-
do_get
|
|
86
|
-
response.should render_template('articles/index')
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
it 'should set the page title to "Tag foo"' do
|
|
90
|
-
do_get
|
|
91
|
-
assigns[:page_title].should == 'Tag foo, everything about foo'
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
it 'should render an error when the tag is empty' do
|
|
95
|
-
@tag.should_receive(:articles) \
|
|
96
|
-
.and_return([])
|
|
97
|
-
|
|
98
|
-
do_get
|
|
99
|
-
|
|
100
|
-
response.status.should == "301 Moved Permanently"
|
|
101
|
-
response.should redirect_to(Blog.default.base_url)
|
|
102
|
-
end
|
|
103
|
-
|
|
104
|
-
it 'should render the atom feed for /articles/tag/foo.atom' do
|
|
105
|
-
get 'show', :id => 'foo', :format => 'atom'
|
|
106
|
-
response.should render_template('articles/_atom_feed')
|
|
107
|
-
end
|
|
108
|
-
|
|
109
|
-
it 'should render the rss feed for /articles/tag/foo.rss' do
|
|
110
|
-
get 'show', :id => 'foo', :format => 'rss'
|
|
111
|
-
response.should render_template('articles/_rss20_feed')
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
|
|
115
|
-
describe TagsController, 'with integrate_view' do
|
|
116
|
-
integrate_views
|
|
117
|
-
|
|
118
|
-
before(:each) do
|
|
119
|
-
get 'show', :id => 'foo'
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
it 'should have good rss feed link in head' do
|
|
123
|
-
response.should have_tag('head>link[href=?]','http://test.host/tag/foo.rss')
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
it 'should have good atom feed link in head' do
|
|
127
|
-
response.should have_tag('head>link[href=?]','http://test.host/tag/foo.atom')
|
|
128
|
-
end
|
|
129
|
-
|
|
130
|
-
end
|
|
131
|
-
|
|
132
|
-
## Old tests that still need conversion
|
|
133
|
-
|
|
134
|
-
# it "test_autodiscovery_tag" do
|
|
135
|
-
# get :tag, :id => 'hardware'
|
|
136
|
-
# assert_response :success
|
|
137
|
-
# assert_select 'link[title=RSS]' do
|
|
138
|
-
# assert_select '[rel=alternate]'
|
|
139
|
-
# assert_select '[type=application/rss+xml]'
|
|
140
|
-
# assert_select '[href=http://test.host/articles/tag/hardware.rss]'
|
|
141
|
-
# end
|
|
142
|
-
# assert_select 'link[title=Atom]' do
|
|
143
|
-
# assert_select '[rel=alternate]'
|
|
144
|
-
# assert_select '[type=application/atom+xml]'
|
|
145
|
-
# assert_select '[href=http://test.host/articles/tag/hardware.atom]'
|
|
146
|
-
# end
|
|
147
|
-
# end
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
require File.dirname(__FILE__) + '/../spec_helper'
|
|
2
|
-
|
|
3
|
-
require 'flickr_mock'
|
|
4
|
-
|
|
5
|
-
describe TextfilterController do
|
|
6
|
-
before do
|
|
7
|
-
reset_whiteboard
|
|
8
|
-
|
|
9
|
-
get :test_action # set up @url; In Rails 1.0, we can't do url_for without it.
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
def blog
|
|
13
|
-
blogs(:default)
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
def filter_text(text, filters, filterparams={})
|
|
17
|
-
TextFilter.filter_text(blog, text, self, filters, filterparams)
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def whiteboard
|
|
21
|
-
@whiteboard ||= Hash.new
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def reset_whiteboard
|
|
25
|
-
@whiteboard = nil
|
|
26
|
-
end
|
|
27
|
-
|
|
28
|
-
it "test_unknown" do
|
|
29
|
-
text = filter_text('*foo*',[:unknowndoesnotexist])
|
|
30
|
-
assert_equal '*foo*', text
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
it "test_smartypants" do
|
|
34
|
-
text = filter_text('"foo"',[:smartypants])
|
|
35
|
-
assert_equal '“foo”', text
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
it "test_markdown" do
|
|
39
|
-
text = filter_text('*foo*', [:markdown])
|
|
40
|
-
assert_equal '<p><em>foo</em></p>', text
|
|
41
|
-
|
|
42
|
-
text = filter_text("foo\n\nbar",[:markdown])
|
|
43
|
-
assert_equal "<p>foo</p>\n\n<p>bar</p>", text
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
it "test_filterchain" do
|
|
47
|
-
assert_equal '<p><em>“foo”</em></p>',
|
|
48
|
-
filter_text('*"foo"*',[:markdown,:smartypants])
|
|
49
|
-
|
|
50
|
-
assert_equal '<p><em>“foo”</em></p>',
|
|
51
|
-
filter_text('*"foo"*',[:doesntexist1,:markdown,"doesn't exist 2",:smartypants,:nopenotmeeither])
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
it "test_flickr" do
|
|
55
|
-
assert_equal "<div style=\"float:left\" class=\"flickrplugin\"><a href=\"http://www.flickr.com/users/scottlaird/31366117\"><img src=\"http://photos23.flickr.com/31366117_b1a791d68e_s.jpg\" width=\"75\" height=\"75\" alt=\"Matz\" title=\"Matz\"/></a><p class=\"caption\" style=\"width:75px\">This is Matz, Ruby's creator</p></div>",
|
|
56
|
-
filter_text('<typo:flickr img="31366117" size="Square" style="float:left"/>',
|
|
57
|
-
[:macropre,:macropost],
|
|
58
|
-
{'flickr-user' => 'scott@sigkill.org'})
|
|
59
|
-
|
|
60
|
-
# Test default image size
|
|
61
|
-
assert_equal "<div style=\"\" class=\"flickrplugin\"><a href=\"http://www.flickr.com/users/scottlaird/31366117\"><img src=\"http://photos23.flickr.com/31366117_b1a791d68e_s.jpg\" width=\"75\" height=\"75\" alt=\"Matz\" title=\"Matz\"/></a><p class=\"caption\" style=\"width:75px\">This is Matz, Ruby's creator</p></div>",
|
|
62
|
-
filter_text('<typo:flickr img="31366117"/>',
|
|
63
|
-
[:macropre,:macropost],
|
|
64
|
-
{'flickr-user' => 'scott@sigkill.org'})
|
|
65
|
-
|
|
66
|
-
# Test with caption=""
|
|
67
|
-
assert_equal "<div style=\"\" class=\"flickrplugin\"><a href=\"http://www.flickr.com/users/scottlaird/31366117\"><img src=\"http://photos23.flickr.com/31366117_b1a791d68e_s.jpg\" width=\"75\" height=\"75\" alt=\"Matz\" title=\"Matz\"/></a></div>",
|
|
68
|
-
filter_text('<typo:flickr img="31366117" caption=""/>',
|
|
69
|
-
[:macropre,:macropost],
|
|
70
|
-
{'flickr-user' => 'scott@sigkill.org'})
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
it "test_broken_flickr_link" do
|
|
74
|
-
assert_equal %{<div class='broken_flickr_link'>\`notaflickrid\' could not be displayed because: <br />Photo not found</div>},
|
|
75
|
-
filter_text('<typo:flickr img="notaflickrid" />',
|
|
76
|
-
[:macropre, :macropost],
|
|
77
|
-
{ 'flickr-user' => 'scott@sigkill.org' })
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
describe 'code textfilter' do
|
|
81
|
-
|
|
82
|
-
describe 'single line' do
|
|
83
|
-
|
|
84
|
-
it 'should made nothin if no args' do
|
|
85
|
-
filter_text('<typo:code>foo-code</typo:code>', [:macropre,:macropost]).should == %{<div class="CodeRay"><pre><notextile>foo-code</notextile></pre></div>}
|
|
86
|
-
end
|
|
87
|
-
|
|
88
|
-
it 'should parse ruby lang' do
|
|
89
|
-
filter_text('<typo:code lang="ruby">foo-code</typo:code>', [:macropre,:macropost]).should == %{<div class="CodeRay"><pre><notextile><span class=\"CodeRay\">foo-code</span></notextile></pre></div>}
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
it 'should parse ruby and xml in same sentence but not in same place' do
|
|
93
|
-
filter_text('<typo:code lang="ruby">foo-code</typo:code> blah blah <typo:code lang="xml">zzz</typo:code>',[:macropre,:macropost]).should == %{<div class="CodeRay"><pre><notextile><span class="CodeRay">foo-code</span></notextile></pre></div> blah blah <div class="CodeRay"><pre><notextile><span class="CodeRay">zzz</span></notextile></pre></div>}
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
end
|
|
97
|
-
|
|
98
|
-
describe 'multiline' do
|
|
99
|
-
|
|
100
|
-
it 'should render ruby' do
|
|
101
|
-
filter_text(%{
|
|
102
|
-
<typo:code lang="ruby">
|
|
103
|
-
class Foo
|
|
104
|
-
def bar
|
|
105
|
-
@a = "zzz"
|
|
106
|
-
end
|
|
107
|
-
end
|
|
108
|
-
</typo:code>
|
|
109
|
-
},[:macropre,:macropost]).should == %{
|
|
110
|
-
<div class=\"CodeRay\"><pre><notextile><span class=\"CodeRay\"><span class=\"r\">class</span> <span class=\"cl\">Foo</span>
|
|
111
|
-
<span class=\"r\">def</span> <span class=\"fu\">bar</span>
|
|
112
|
-
<span class=\"iv\">@a</span> = <span class=\"s\"><span class=\"dl\">"</span><span class=\"k\">zzz</span><span class=\"dl\">"</span></span>
|
|
113
|
-
<span class=\"r\">end</span>
|
|
114
|
-
<span class=\"r\">end</span></span></notextile></pre></div>
|
|
115
|
-
}
|
|
116
|
-
end
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
it "test_named_filter" do
|
|
121
|
-
assert_equal '<p><em>“foo”</em></p>',
|
|
122
|
-
TextFilter.filter_text_by_name(blog, '*"foo"*', 'markdown smartypants')
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
it "test_code_plus_markup_chain" do
|
|
126
|
-
text = <<-EOF
|
|
127
|
-
*header text here*
|
|
128
|
-
|
|
129
|
-
<typo:code lang="ruby">
|
|
130
|
-
class test
|
|
131
|
-
def method
|
|
132
|
-
"foo"
|
|
133
|
-
end
|
|
134
|
-
end
|
|
135
|
-
</typo:code>
|
|
136
|
-
|
|
137
|
-
_footer text here_
|
|
138
|
-
|
|
139
|
-
EOF
|
|
140
|
-
|
|
141
|
-
expects_markdown = <<-EOF
|
|
142
|
-
<p><em>header text here</em></p>
|
|
143
|
-
|
|
144
|
-
<div class="CodeRay"><pre><span class="CodeRay"><span class="r">class</span> <span class="cl">test</span>
|
|
145
|
-
<span class="r">def</span> <span class="fu">method</span>
|
|
146
|
-
<span class="s"><span class="dl">"</span><span class="k">foo</span><span class="dl">"</span></span>
|
|
147
|
-
<span class="r">end</span>
|
|
148
|
-
<span class="r">end</span></span></pre></div>
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<p><em>footer text here</em></p>
|
|
152
|
-
EOF
|
|
153
|
-
|
|
154
|
-
expects_textile = <<-EOF
|
|
155
|
-
<p><strong>header text here</strong></p>
|
|
156
|
-
<div class="CodeRay"><pre><span class="CodeRay"><span class="r">class</span> <span class="cl">test</span>
|
|
157
|
-
<span class="r">def</span> <span class="fu">method</span>
|
|
158
|
-
<span class="s"><span class="dl">"</span><span class="k">foo</span><span class="dl">"</span></span>
|
|
159
|
-
<span class="r">end</span>
|
|
160
|
-
<span class="r">end</span></span></pre></div>
|
|
161
|
-
<p><em>footer text here</em></p>
|
|
162
|
-
EOF
|
|
163
|
-
|
|
164
|
-
assert_equal expects_markdown.strip, TextFilter.filter_text_by_name(blog, text, 'markdown')
|
|
165
|
-
assert_equal expects_textile.strip, TextFilter.filter_text_by_name(blog, text, 'textile')
|
|
166
|
-
end
|
|
167
|
-
|
|
168
|
-
it "test_lightbox" do
|
|
169
|
-
assert_equal "<div style=\"float:left\" class=\"lightboxplugin\"><a href=\"http://photos23.flickr.com/31366117_b1a791d68e_b.jpg\" rel=\"lightbox\" title=\"Matz\"><img src=\"http://photos23.flickr.com/31366117_b1a791d68e_t.jpg\" width=\"67\" height=\"100\" alt=\"Matz\" title=\"Matz\"/></a><p class=\"caption\" style=\"width:67px\">This is Matz, Ruby's creator</p></div>",
|
|
170
|
-
filter_text('<typo:lightbox img="31366117" thumbsize="Thumbnail" displaysize="Large" style="float:left"/>',
|
|
171
|
-
[:macropre,:macropost],
|
|
172
|
-
{})
|
|
173
|
-
|
|
174
|
-
# Test default thumb image size
|
|
175
|
-
assert_equal "<div style=\"\" class=\"lightboxplugin\"><a href=\"http://photos23.flickr.com/31366117_b1a791d68e_b.jpg\" rel=\"lightbox\" title=\"Matz\"><img src=\"http://photos23.flickr.com/31366117_b1a791d68e_s.jpg\" width=\"75\" height=\"75\" alt=\"Matz\" title=\"Matz\"/></a><p class=\"caption\" style=\"width:75px\">This is Matz, Ruby's creator</p></div>",
|
|
176
|
-
filter_text('<typo:lightbox img="31366117" displaysize="Large"/>',
|
|
177
|
-
[:macropre,:macropost],
|
|
178
|
-
{})
|
|
179
|
-
|
|
180
|
-
# Test default display image size
|
|
181
|
-
assert_equal "<div style=\"\" class=\"lightboxplugin\"><a href=\"http://photos23.flickr.com/31366117_b1a791d68e_o.jpg\" rel=\"lightbox\" title=\"Matz\"><img src=\"http://photos23.flickr.com/31366117_b1a791d68e_s.jpg\" width=\"75\" height=\"75\" alt=\"Matz\" title=\"Matz\"/></a><p class=\"caption\" style=\"width:75px\">This is Matz, Ruby's creator</p></div>",
|
|
182
|
-
filter_text('<typo:lightbox img="31366117"/>',
|
|
183
|
-
[:macropre,:macropost],
|
|
184
|
-
{})
|
|
185
|
-
|
|
186
|
-
# Test with caption=""
|
|
187
|
-
assert_equal "<div style=\"\" class=\"lightboxplugin\"><a href=\"http://photos23.flickr.com/31366117_b1a791d68e_o.jpg\" rel=\"lightbox\" title=\"Matz\"><img src=\"http://photos23.flickr.com/31366117_b1a791d68e_s.jpg\" width=\"75\" height=\"75\" alt=\"Matz\" title=\"Matz\"/></a></div>",
|
|
188
|
-
filter_text('<typo:lightbox img="31366117" caption=""/>',
|
|
189
|
-
[:macropre,:macropost],
|
|
190
|
-
{})
|
|
191
|
-
end
|
|
192
|
-
end
|