radiant 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of radiant might be problematic. Click here for more details.
- data/CHANGELOG +61 -7
- data/CONTRIBUTORS +15 -0
- data/app/controllers/admin/export_controller.rb +1 -1
- data/app/controllers/admin/page_controller.rb +1 -0
- data/app/controllers/admin/user_controller.rb +2 -1
- data/app/controllers/application.rb +7 -8
- data/app/helpers/admin/node_helper.rb +84 -0
- data/app/helpers/admin/page_helper.rb +1 -19
- data/app/helpers/application_helper.rb +15 -9
- data/app/models/file_not_found_page.rb +2 -2
- data/app/models/page.rb +22 -18
- data/app/models/page_context.rb +9 -0
- data/app/models/radiant/config.rb +4 -2
- data/app/models/response_cache.rb +18 -12
- data/app/models/standard_tags.rb +111 -50
- data/app/views/admin/extension/index.rhtml +2 -2
- data/app/views/admin/layout/edit.rhtml +2 -2
- data/app/views/admin/layout/remove.rhtml +2 -2
- data/app/views/admin/page/_node.rhtml +4 -26
- data/app/views/admin/page/_part.rhtml +9 -14
- data/app/views/admin/page/edit.rhtml +38 -121
- data/app/views/admin/page/index.rhtml +2 -6
- data/app/views/admin/page/remove.rhtml +2 -2
- data/app/views/admin/snippet/edit.rhtml +3 -3
- data/app/views/admin/snippet/index.rhtml +2 -2
- data/app/views/admin/snippet/remove.rhtml +2 -2
- data/app/views/admin/user/edit.rhtml +4 -4
- data/app/views/admin/user/preferences.rhtml +2 -2
- data/app/views/admin/welcome/login.rhtml +1 -1
- data/config/environment.rb +79 -78
- data/db/schema.rb +2 -0
- data/lib/local_time.rb +12 -0
- data/lib/plugins/extension_patches/lib/fixture_loading_extension.rb +1 -1
- data/lib/plugins/extension_patches/lib/mailer_view_paths_extension.rb +3 -3
- data/lib/radiant.rb +1 -1
- data/lib/radiant/extension.rb +9 -3
- data/lib/radiant/extension_loader.rb +2 -2
- data/lib/tasks/extensions.rake +23 -8
- data/public/javascripts/admin.js +89 -0
- data/public/javascripts/controls.js +486 -354
- data/public/javascripts/dragdrop.js +90 -58
- data/public/javascripts/effects.js +398 -364
- data/public/javascripts/pngfix.js +37 -37
- data/public/javascripts/prototype.js +2764 -1095
- data/public/javascripts/ruledtable.js +10 -25
- data/public/javascripts/sitemap.js +74 -112
- data/public/javascripts/string.js +1 -7
- data/public/javascripts/tabcontrol.js +71 -86
- data/public/javascripts/tag_reference_search.js +19 -26
- data/public/stylesheets/admin/main.css +11 -5
- data/test/fixtures/extensions/01_basic/lib/new_module.rb +2 -0
- data/test/fixtures/page_parts.yml +16 -1
- data/test/fixtures/pages.yml +47 -84
- data/test/functional/extension_initialization_test.rb +11 -0
- data/test/helpers/login_test_helper.rb +12 -1
- data/test/helpers/page_test_helper.rb +6 -0
- data/test/helpers/render_test_helper.rb +11 -8
- data/test/test_helper.rb +1 -12
- data/test/unit/file_not_found_page_test.rb +5 -1
- data/test/unit/local_time_test.rb +45 -0
- data/test/unit/page_context_test.rb +32 -1
- data/test/unit/page_test.rb +45 -11
- data/test/unit/radiant/config_test.rb +1 -1
- data/test/unit/response_cache_test.rb +27 -2
- data/test/unit/standard_tags_test.rb +60 -15
- data/vendor/extensions/archive/README +29 -0
- data/vendor/extensions/archive/Rakefile +25 -0
- data/{app → vendor/extensions/archive/app}/models/archive_day_index_page.rb +0 -0
- data/{app → vendor/extensions/archive/app}/models/archive_finder.rb +8 -6
- data/{app → vendor/extensions/archive/app}/models/archive_month_index_page.rb +0 -0
- data/{app → vendor/extensions/archive/app}/models/archive_page.rb +0 -0
- data/{app → vendor/extensions/archive/app}/models/archive_year_index_page.rb +0 -0
- data/vendor/extensions/archive/archive_extension.rb +19 -0
- data/{lib → vendor/extensions/archive/lib}/archive_index_tags_and_methods.rb +0 -0
- data/vendor/extensions/archive/lib/tasks/archive_extension_tasks.rake +28 -0
- data/vendor/extensions/archive/test/fixtures/pages.yml +397 -0
- data/vendor/extensions/archive/test/functional/archive_extension_test.rb +16 -0
- data/{test → vendor/extensions/archive/test}/helpers/archive_index_test_helper.rb +0 -0
- data/vendor/extensions/archive/test/test_helper.rb +19 -0
- data/{test → vendor/extensions/archive/test}/unit/archive_day_index_page_test.rb +0 -0
- data/{test → vendor/extensions/archive/test}/unit/archive_month_index_page_test.rb +0 -0
- data/{test → vendor/extensions/archive/test}/unit/archive_page_test.rb +7 -1
- data/{test → vendor/extensions/archive/test}/unit/archive_year_index_page_test.rb +0 -0
- data/vendor/rails/actionmailer/CHANGELOG +10 -0
- data/vendor/rails/actionmailer/Rakefile +1 -1
- data/vendor/rails/actionmailer/lib/action_mailer/version.rb +1 -1
- data/vendor/rails/actionpack/CHANGELOG +51 -2
- data/vendor/rails/actionpack/Rakefile +1 -1
- data/vendor/rails/actionpack/lib/action_controller/assertions/dom_assertions.rb +2 -2
- data/vendor/rails/actionpack/lib/action_controller/assertions/model_assertions.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/assertions/response_assertions.rb +3 -0
- data/vendor/rails/actionpack/lib/action_controller/assertions/routing_assertions.rb +1 -0
- data/vendor/rails/actionpack/lib/action_controller/assertions/selector_assertions.rb +2 -0
- data/vendor/rails/actionpack/lib/action_controller/base.rb +7 -1
- data/vendor/rails/actionpack/lib/action_controller/caching.rb +39 -38
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/pstore_performance_fix.rb +30 -0
- data/vendor/rails/actionpack/lib/action_controller/cgi_ext/raw_post_data_fix.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/cgi_process.rb +13 -4
- data/vendor/rails/actionpack/lib/action_controller/cookies.rb +5 -3
- data/vendor/rails/actionpack/lib/action_controller/filters.rb +176 -77
- data/vendor/rails/actionpack/lib/action_controller/integration.rb +31 -21
- data/vendor/rails/actionpack/lib/action_controller/macros/in_place_editing.rb +1 -1
- data/vendor/rails/actionpack/lib/action_controller/pagination.rb +7 -1
- data/vendor/rails/actionpack/lib/action_controller/resources.rb +117 -32
- data/vendor/rails/actionpack/lib/action_controller/routing.rb +56 -23
- data/vendor/rails/actionpack/lib/action_controller/test_process.rb +5 -2
- data/vendor/rails/actionpack/lib/action_controller/url_rewriter.rb +4 -1
- data/vendor/rails/actionpack/lib/action_controller/verification.rb +1 -0
- data/vendor/rails/actionpack/lib/action_pack/version.rb +1 -1
- data/vendor/rails/actionpack/lib/action_view/base.rb +25 -19
- data/vendor/rails/actionpack/lib/action_view/compiled_templates.rb +2 -2
- data/vendor/rails/actionpack/lib/action_view/helpers/active_record_helper.rb +18 -18
- data/vendor/rails/actionpack/lib/action_view/helpers/debug_helper.rb +10 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/deprecated_helper.rb +3 -0
- data/vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb +33 -17
- data/vendor/rails/actionpack/test/activerecord/pagination_test.rb +9 -0
- data/vendor/rails/actionpack/test/controller/action_pack_assertions_test.rb +13 -0
- data/vendor/rails/actionpack/test/controller/addresses_render_test.rb +4 -1
- data/vendor/rails/actionpack/test/controller/base_test.rb +1 -1
- data/vendor/rails/actionpack/test/controller/caching_test.rb +3 -2
- data/vendor/rails/actionpack/test/controller/cookie_test.rb +11 -0
- data/vendor/rails/actionpack/test/controller/deprecation/deprecated_base_methods_test.rb +18 -0
- data/vendor/rails/actionpack/test/controller/filter_params_test.rb +1 -0
- data/vendor/rails/actionpack/test/controller/filters_test.rb +149 -26
- data/vendor/rails/actionpack/test/controller/integration_test.rb +93 -8
- data/vendor/rails/actionpack/test/controller/resources_test.rb +215 -36
- data/vendor/rails/actionpack/test/controller/routing_test.rb +2 -2
- data/vendor/rails/actionpack/test/controller/test_test.rb +16 -0
- data/vendor/rails/actionpack/test/controller/url_rewriter_test.rb +66 -10
- data/vendor/rails/actionpack/test/controller/verification_test.rb +15 -0
- data/vendor/rails/actionpack/test/fixtures/test/hello_world.rxml +2 -1
- data/vendor/rails/actionpack/test/template/asset_tag_helper_test.rb +5 -0
- data/vendor/rails/actionpack/test/template/compiled_templates_test.rb +29 -17
- data/vendor/rails/actionpack/test/template/javascript_helper_test.rb +4 -4
- data/vendor/rails/actionpack/test/template/number_helper_test.rb +1 -1
- data/vendor/rails/actionpack/test/template/prototype_helper_test.rb +13 -13
- data/vendor/rails/actionwebservice/CHANGELOG +14 -0
- data/vendor/rails/actionwebservice/Rakefile +2 -2
- data/vendor/rails/actionwebservice/lib/action_web_service/version.rb +1 -1
- data/vendor/rails/activerecord/CHANGELOG +34 -0
- data/vendor/rails/activerecord/Rakefile +1 -1
- data/vendor/rails/activerecord/lib/active_record/acts/list.rb +14 -2
- data/vendor/rails/activerecord/lib/active_record/acts/tree.rb +7 -0
- data/vendor/rails/activerecord/lib/active_record/associations.rb +29 -14
- data/vendor/rails/activerecord/lib/active_record/associations/association_collection.rb +5 -1
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_association.rb +2 -2
- data/vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb +10 -0
- data/vendor/rails/activerecord/lib/active_record/base.rb +12 -3
- data/vendor/rails/activerecord/lib/active_record/calculations.rb +2 -2
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/quoting.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb +1 -0
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb +2 -2
- data/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb +54 -38
- data/vendor/rails/activerecord/lib/active_record/deprecated_finders.rb +3 -3
- data/vendor/rails/activerecord/lib/active_record/fixtures.rb +1 -1
- data/vendor/rails/activerecord/lib/active_record/timestamp.rb +0 -9
- data/vendor/rails/activerecord/lib/active_record/version.rb +1 -1
- data/vendor/rails/activerecord/test/associations/eager_test.rb +13 -0
- data/vendor/rails/activerecord/test/associations/join_model_test.rb +10 -1
- data/vendor/rails/activerecord/test/associations_test.rb +36 -3
- data/vendor/rails/activerecord/test/base_test.rb +17 -4
- data/vendor/rails/activerecord/test/defaults_test.rb +15 -0
- data/vendor/rails/activerecord/test/fixtures/author.rb +1 -0
- data/vendor/rails/activerecord/test/fixtures/binaries.yml +437 -0
- data/vendor/rails/activerecord/test/fixtures/db_definitions/schema.rb +13 -0
- data/vendor/rails/activerecord/test/fixtures/developer.rb +10 -0
- data/vendor/rails/activerecord/test/fixtures_test.rb +9 -5
- data/vendor/rails/activerecord/test/migration_test.rb +9 -10
- data/vendor/rails/activerecord/test/mixin_test.rb +47 -0
- data/vendor/rails/activerecord/test/validations_test.rb +2 -2
- data/vendor/rails/activesupport/CHANGELOG +16 -0
- data/vendor/rails/activesupport/lib/active_support/core_ext/blank.rb +9 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/hash/conversions.rb +48 -3
- data/vendor/rails/activesupport/lib/active_support/core_ext/module/introspection.rb +14 -0
- data/vendor/rails/activesupport/lib/active_support/dependencies.rb +3 -3
- data/vendor/rails/activesupport/lib/active_support/json/encoders/core.rb +5 -3
- data/vendor/rails/activesupport/lib/active_support/multibyte/chars.rb +6 -6
- data/vendor/rails/activesupport/lib/active_support/version.rb +1 -1
- data/vendor/rails/activesupport/test/core_ext/hash_ext_test.rb +37 -0
- data/vendor/rails/activesupport/test/core_ext/module_test.rb +8 -0
- data/vendor/rails/activesupport/test/dependencies_test.rb +11 -0
- data/vendor/rails/activesupport/test/{json.rb → json_test.rb} +15 -5
- data/vendor/rails/railties/CHANGELOG +25 -1
- data/vendor/rails/railties/README +32 -3
- data/vendor/rails/railties/Rakefile +5 -5
- data/vendor/rails/railties/environments/boot.rb +12 -18
- data/vendor/rails/railties/environments/environment.rb +15 -15
- data/vendor/rails/railties/lib/dispatcher.rb +1 -2
- data/vendor/rails/railties/lib/initializer.rb +33 -9
- data/vendor/rails/railties/lib/rails/version.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold/scaffold_generator.rb +1 -1
- data/vendor/rails/railties/lib/rails_generator/generators/components/scaffold_resource/scaffold_resource_generator.rb +1 -0
- data/vendor/rails/railties/lib/railties_path.rb +1 -1
- data/vendor/rails/railties/lib/tasks/framework.rake +4 -4
- data/vendor/rails/railties/lib/tasks/routes.rake +17 -0
- data/vendor/rails/release.rb +2 -2
- metadata +1877 -1848
@@ -1,30 +1,23 @@
|
|
1
|
-
function hasWordInElement(word, element) {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
function hasWordInElement(word, element) {
|
2
|
+
if (element.nodeType == Node.TEXT_NODE) {
|
3
|
+
return element.nodeValue.include(word) != null;
|
4
|
+
} else {
|
5
|
+
return $A(element.childNodes).any(function(child) {
|
6
|
+
return hasWordInElement(word, child);
|
7
|
+
});
|
8
|
+
}
|
9
9
|
}
|
10
|
+
|
10
11
|
var searchingOn = ""
|
12
|
+
|
11
13
|
function observeTagSearch(element, value) {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
divs = $$("div.tag-description");
|
22
|
-
$A(divs).each(function (div){
|
23
|
-
if(hasWordInElement(value, div))
|
24
|
-
Element.show(div);
|
25
|
-
else
|
26
|
-
Element.hide(div);
|
27
|
-
});
|
28
|
-
}
|
14
|
+
if (value.length < 3 && searchingOn != "") {
|
15
|
+
searchingOn = "";
|
16
|
+
$$("div.tag-description").invoke('show');
|
17
|
+
} else if (value.length >= 3 && searchingOn != value) {
|
18
|
+
searchingOn = value
|
19
|
+
$$("div.tag-description").each(function(div) {
|
20
|
+
div[hasWordInElement(value, div) ? 'show' : 'hide']();
|
21
|
+
});
|
22
|
+
}
|
29
23
|
}
|
30
|
-
|
@@ -5,8 +5,8 @@ body {
|
|
5
5
|
padding: 0;
|
6
6
|
}
|
7
7
|
img, input[type='image'] {
|
8
|
-
|
9
|
-
|
8
|
+
border: 0;
|
9
|
+
vertical-align: middle;
|
10
10
|
}
|
11
11
|
h3 {
|
12
12
|
font-size: 130%;
|
@@ -24,6 +24,9 @@ h3 {
|
|
24
24
|
color: red;
|
25
25
|
}
|
26
26
|
|
27
|
+
table {
|
28
|
+
border-collapse: collapse;
|
29
|
+
}
|
27
30
|
|
28
31
|
/* main layout */
|
29
32
|
|
@@ -252,7 +255,8 @@ h1 {
|
|
252
255
|
font-style: italic;
|
253
256
|
font-weight: normal;
|
254
257
|
}
|
255
|
-
#content table.index tr.highlight
|
258
|
+
#content table.index tr.highlight,
|
259
|
+
#content table.index tr:hover {
|
256
260
|
background-color: #ffffb3;
|
257
261
|
}
|
258
262
|
#content table.index .no-children .w1 {
|
@@ -464,7 +468,7 @@ h1 {
|
|
464
468
|
height: 280px;
|
465
469
|
border: 1px solid #cdc295;
|
466
470
|
font-family: Monaco, "Courier New", Courier, monospace;
|
467
|
-
font-size:
|
471
|
+
font-size: 95%;
|
468
472
|
}
|
469
473
|
#content #pages label {
|
470
474
|
font-size: 85%;
|
@@ -490,7 +494,9 @@ h1 {
|
|
490
494
|
#popups .popup .close-link {
|
491
495
|
font-size: 85%;
|
492
496
|
}
|
493
|
-
|
497
|
+
#add-part-popup {
|
498
|
+
width: 17em;
|
499
|
+
}
|
494
500
|
|
495
501
|
/* tag reference */
|
496
502
|
|
@@ -96,4 +96,19 @@ inheritance_test_part:
|
|
96
96
|
id: 19
|
97
97
|
name: body
|
98
98
|
content: <r:title /> inherited body.
|
99
|
-
page_id: 47
|
99
|
+
page_id: 47
|
100
|
+
if_dev_test_part:
|
101
|
+
id: 20
|
102
|
+
name: if_dev
|
103
|
+
content: <r:if_dev>dev</r:if_dev>
|
104
|
+
page_id: 60
|
105
|
+
unless_dev_test_part:
|
106
|
+
id: 21
|
107
|
+
name: unless_dev
|
108
|
+
content: <r:unless_dev>not dev</r:unless_dev>
|
109
|
+
page_id: 60
|
110
|
+
another:
|
111
|
+
id: 22
|
112
|
+
name: body
|
113
|
+
content: another page
|
114
|
+
page_id: 61
|
data/test/fixtures/pages.yml
CHANGED
@@ -95,89 +95,6 @@ child:
|
|
95
95
|
status_id: 100
|
96
96
|
parent_id: 10
|
97
97
|
published_at: 2006-01-30 08:41:07
|
98
|
-
archive:
|
99
|
-
id: 12
|
100
|
-
title: Archive
|
101
|
-
breadcrumb: Parent
|
102
|
-
slug: archive
|
103
|
-
class_name: ArchivePage
|
104
|
-
status_id: 100
|
105
|
-
parent_id: 1
|
106
|
-
published_at: 2006-01-30 08:41:07
|
107
|
-
year_index:
|
108
|
-
id: 41
|
109
|
-
title: %Y Archive
|
110
|
-
slug: year
|
111
|
-
class_name: ArchiveYearIndexPage
|
112
|
-
status_id: 101
|
113
|
-
parent_id: 12
|
114
|
-
virtual: true
|
115
|
-
published_at: 2006-02-05 08:44:07
|
116
|
-
month_index:
|
117
|
-
id: 42
|
118
|
-
title: %B %Y Archive
|
119
|
-
slug: month
|
120
|
-
class_name: ArchiveMonthIndexPage
|
121
|
-
status_id: 101
|
122
|
-
parent_id: 12
|
123
|
-
virtual: true
|
124
|
-
published_at: 2006-02-05 08:44:07
|
125
|
-
day_index:
|
126
|
-
id: 43
|
127
|
-
title: %B %d, %Y Archive
|
128
|
-
slug: day
|
129
|
-
class_name: ArchiveDayIndexPage
|
130
|
-
status_id: 101
|
131
|
-
parent_id: 12
|
132
|
-
virtual: true
|
133
|
-
published_at: 2006-02-05 08:44:07
|
134
|
-
article:
|
135
|
-
id: 13
|
136
|
-
title: Article
|
137
|
-
breadcrumb: Article
|
138
|
-
slug: article
|
139
|
-
status_id: 100
|
140
|
-
parent_id: 12
|
141
|
-
published_at: 2000-05-01 08:41:07
|
142
|
-
article2:
|
143
|
-
id: 14
|
144
|
-
title: Article Two
|
145
|
-
breadcrumb: Article Two
|
146
|
-
slug: article-2
|
147
|
-
status_id: 100
|
148
|
-
parent_id: 12
|
149
|
-
published_at: 2000-06-09 08:42:04
|
150
|
-
article3:
|
151
|
-
id: 44
|
152
|
-
title: Article Three
|
153
|
-
breadcrumb: Article Three
|
154
|
-
slug: article-3
|
155
|
-
status_id: 100
|
156
|
-
parent_id: 12
|
157
|
-
published_at: 2000-06-10 12:02:43
|
158
|
-
article4:
|
159
|
-
id: 45
|
160
|
-
title: Article Four
|
161
|
-
breadcrumb: Article Four
|
162
|
-
slug: article-4
|
163
|
-
status_id: 100
|
164
|
-
parent_id: 12
|
165
|
-
published_at: 2000-08-06 03:32:31
|
166
|
-
article5:
|
167
|
-
id: 46
|
168
|
-
title: Article Five
|
169
|
-
breadcrumb: Article Five
|
170
|
-
slug: article-5
|
171
|
-
status_id: 100
|
172
|
-
parent_id: 12
|
173
|
-
published_at: 2001-08-06 03:32:31
|
174
|
-
article_draft:
|
175
|
-
id: 53
|
176
|
-
title: Draft Article
|
177
|
-
breadcrumb: Draft Article
|
178
|
-
slug: draft
|
179
|
-
status_id: 1
|
180
|
-
parent_id: 12
|
181
98
|
draft:
|
182
99
|
id: 15
|
183
100
|
title: Draft Page
|
@@ -247,7 +164,23 @@ news_child_published_2:
|
|
247
164
|
slug: another-great-day-for-ruby
|
248
165
|
status_id: 100
|
249
166
|
parent_id: 30
|
250
|
-
published_at: 2006-02-05 08:44:07
|
167
|
+
published_at: 2006-02-05 08:44:07
|
168
|
+
news_child_published_3:
|
169
|
+
id: 65
|
170
|
+
title: Later That Day
|
171
|
+
breadcrumb: news
|
172
|
+
slug: later-that-day
|
173
|
+
status_id: 100
|
174
|
+
parent_id: 30
|
175
|
+
published_at: 2006-02-06 09:44:07
|
176
|
+
news_child_published_4:
|
177
|
+
id: 66
|
178
|
+
title: Next Year in Ruby
|
179
|
+
breadcrumb: news
|
180
|
+
slug: next-year-in-ruby
|
181
|
+
status_id: 100
|
182
|
+
parent_id: 30
|
183
|
+
published_at: 2007-01-30 08:44:07
|
251
184
|
grandchild:
|
252
185
|
id: 33
|
253
186
|
title: Grandchild
|
@@ -374,3 +307,33 @@ custom_404:
|
|
374
307
|
status_id: 100
|
375
308
|
parent_id: 58
|
376
309
|
published_at: 2006-02-05 08:44:07
|
310
|
+
devtags:
|
311
|
+
id: 60
|
312
|
+
title: Dev Test Page
|
313
|
+
slug: devtags
|
314
|
+
status_id: 100
|
315
|
+
parent_id: 1
|
316
|
+
published_at: 2006-02-05 08:44:07
|
317
|
+
another:
|
318
|
+
id: 61
|
319
|
+
title: Another Page
|
320
|
+
slug: another
|
321
|
+
status_id: 100
|
322
|
+
parent_id: 1
|
323
|
+
published_at: 2006-02-05 08:44:07
|
324
|
+
childless:
|
325
|
+
id: 62
|
326
|
+
title: Childless Page
|
327
|
+
slug: childless
|
328
|
+
status_id: 100
|
329
|
+
parent_id: 1
|
330
|
+
published_at: 2006-02-05 08:44:07
|
331
|
+
virtual:
|
332
|
+
id: 63
|
333
|
+
title: Virtual Page
|
334
|
+
class_name: VirtualPage
|
335
|
+
slug: virtual
|
336
|
+
virtual: 1
|
337
|
+
status_id: 100
|
338
|
+
parent_id: 19
|
339
|
+
published_at: 2006-02-05 08:44:07
|
@@ -70,6 +70,8 @@ class ExtensionInitializationTest < Test::Unit::TestCase
|
|
70
70
|
assert_nothing_raised { Radiant::Extension.const_get(:PLUGIN_PLUGIN_NORMAL) }
|
71
71
|
assert_equal BasicExtension.root + "/vendor/plugins/plugin_normal", Radiant::Extension::PLUGIN_PLUGIN_NORMAL
|
72
72
|
assert $LOAD_PATH.include?(BasicExtension.root + "/vendor/plugins/plugin_normal/lib")
|
73
|
+
assert Dependencies.load_paths.include?(BasicExtension.root + "/vendor/plugins/plugin_normal/lib")
|
74
|
+
assert Dependencies.load_once_paths.include?(BasicExtension.root + "/vendor/plugins/plugin_normal/lib")
|
73
75
|
assert defined?(NormalPlugin)
|
74
76
|
end
|
75
77
|
|
@@ -77,11 +79,20 @@ class ExtensionInitializationTest < Test::Unit::TestCase
|
|
77
79
|
assert_nothing_raised { Radiant::Extension.const_get(:PLUGIN_MULTIPLE) }
|
78
80
|
assert_equal BasicExtension.root + "/vendor/plugins/multiple", Radiant::Extension::PLUGIN_MULTIPLE
|
79
81
|
assert $LOAD_PATH.include?(BasicExtension.root + "/vendor/plugins/multiple/lib")
|
82
|
+
assert Dependencies.load_paths.include?(BasicExtension.root + "/vendor/plugins/multiple/lib")
|
83
|
+
assert Dependencies.load_once_paths.include?(BasicExtension.root + "/vendor/plugins/multiple/lib")
|
80
84
|
assert defined?(Multiple)
|
81
85
|
assert_not_equal OverridingExtension.root + "/vendor/plugins/multiple", Radiant::Extension::PLUGIN_MULTIPLE
|
82
86
|
assert !$LOAD_PATH.include?(OverridingExtension.root + "/vendor/plugins/multiple/lib")
|
87
|
+
assert !Dependencies.load_paths.include?(OverridingExtension.root + "/vendor/plugins/multiple/lib")
|
88
|
+
assert !Dependencies.load_once_paths.include?(OverridingExtension.root + "/vendor/plugins/multiple/lib")
|
83
89
|
end
|
84
90
|
|
91
|
+
def test_should_add_extension_load_paths_to_requirable_load_path
|
92
|
+
assert_nothing_raised { require 'new_module' }
|
93
|
+
assert defined?(NewModule)
|
94
|
+
end
|
95
|
+
|
85
96
|
private
|
86
97
|
|
87
98
|
def assert_admin_tabs(more_tabs = [])
|
@@ -9,4 +9,15 @@ module LoginTestHelper
|
|
9
9
|
@request ||= ActionController::TestRequest.new
|
10
10
|
@request.session['user_id'] = logged_in_user.id
|
11
11
|
end
|
12
|
-
|
12
|
+
|
13
|
+
def logout
|
14
|
+
@request ||= ActionController::TestRequest.new
|
15
|
+
@request.session['user_id'] = nil
|
16
|
+
end
|
17
|
+
|
18
|
+
def assert_requires_login
|
19
|
+
yield if block_given?
|
20
|
+
assert_response :redirect
|
21
|
+
assert_redirected_to :controller => "admin/welcome", :action => "login"
|
22
|
+
end
|
23
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module RenderTestHelper
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
def assert_renders(expected, input, url = nil, host = nil)
|
4
|
+
output = get_render_output(input, url, host)
|
4
5
|
message = "<#{expected.inspect}> expected but was <#{output.inspect}>"
|
5
6
|
assert_block(message) { expected == output }
|
6
7
|
end
|
@@ -44,14 +45,16 @@ module RenderTestHelper
|
|
44
45
|
|
45
46
|
private
|
46
47
|
|
47
|
-
def get_render_output(input, url)
|
48
|
-
setup_page(url)
|
49
|
-
@page.
|
48
|
+
def get_render_output(input, url, host = nil)
|
49
|
+
setup_page(url, host)
|
50
|
+
@page.send(:parse, input)
|
50
51
|
end
|
51
|
-
|
52
|
-
def setup_page(url = nil)
|
52
|
+
|
53
|
+
def setup_page(url = nil, host = nil)
|
53
54
|
@page.request = ActionController::TestRequest.new
|
54
55
|
@page.request.request_uri = 'http://testhost.tld' + (url || @page.url)
|
56
|
+
@page.request.host = host unless host.nil?
|
55
57
|
@page.response = ActionController::TestResponse.new
|
56
58
|
end
|
57
|
-
|
59
|
+
|
60
|
+
end
|
data/test/test_helper.rb
CHANGED
@@ -37,17 +37,6 @@ unless defined? TEST_ROOT
|
|
37
37
|
# Make sure instance installs know where fixtures are
|
38
38
|
self.fixture_path = ["#{TEST_ROOT}/fixtures"]
|
39
39
|
|
40
|
-
# Session key stringification fix for Rails 1.2.2
|
41
|
-
%w( get post put delete head ).each do |method|
|
42
|
-
class_eval <<-EOV, __FILE__, __LINE__
|
43
|
-
def #{method}(action, parameters = nil, session = nil, flash = nil)
|
44
|
-
@request.env['REQUEST_METHOD'] = "#{method.upcase}" if defined?(@request)
|
45
|
-
session = session.stringify_keys if session.kind_of? Hash
|
46
|
-
process(action, parameters, session, flash)
|
47
|
-
end
|
48
|
-
EOV
|
49
|
-
end
|
50
|
-
|
51
40
|
class << self
|
52
41
|
# Class method for test helpers
|
53
42
|
def test_helper(*names)
|
@@ -70,4 +59,4 @@ unless defined? TEST_ROOT
|
|
70
59
|
alias :test_helpers :test_helper
|
71
60
|
end
|
72
61
|
end
|
73
|
-
end
|
62
|
+
end
|
@@ -11,6 +11,10 @@ class FileNotFoundTest < Test::Unit::TestCase
|
|
11
11
|
def test_url
|
12
12
|
assert_renders 'http://testhost.tld/gallery/asdf?param=4', '<r:attempted_url />', '/gallery/asdf?param=4'
|
13
13
|
end
|
14
|
+
|
15
|
+
def test_url__malicious_url
|
16
|
+
assert_renders 'http://testhost.tld/gallery/<script>alert("evil")</script>', '<r:attempted_url />', '/gallery/<script>alert("evil")</script>'
|
17
|
+
end
|
14
18
|
|
15
19
|
def test_virtual
|
16
20
|
assert_equal true, @page.virtual?
|
@@ -24,4 +28,4 @@ class FileNotFoundTest < Test::Unit::TestCase
|
|
24
28
|
assert_headers({'Status' => '404 Not Found'}, '/gallery/asdf')
|
25
29
|
end
|
26
30
|
|
27
|
-
end
|
31
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../test_helper'
|
2
|
+
|
3
|
+
class MockClass; include LocalTime; end
|
4
|
+
|
5
|
+
class LocalTimeTest < Test::Unit::TestCase
|
6
|
+
|
7
|
+
def setup
|
8
|
+
@obj = MockClass.new
|
9
|
+
@conf = Radiant::Config
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_adjust_time_with_no_timezone
|
13
|
+
time = Time.gm 2004
|
14
|
+
new_time = @obj.adjust_time(time)
|
15
|
+
assert_equal time, new_time
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_adjust_time_with_garbage_timezone
|
19
|
+
@conf["local.timezone"] = "Timezone that doesnt exist"
|
20
|
+
|
21
|
+
time = Time.gm 2004
|
22
|
+
new_time = @obj.adjust_time time
|
23
|
+
|
24
|
+
assert_equal time, new_time
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_adjust_time_with_numeric_timezone
|
28
|
+
offset = -10.hours # Hawaii
|
29
|
+
@conf["local.timezone"] = offset
|
30
|
+
|
31
|
+
time = Time.gm 2004
|
32
|
+
hawaii_time = @obj.adjust_time time
|
33
|
+
assert_equal offset, hawaii_time - time
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_adjust_time_with_string_timezone
|
37
|
+
@conf["local.timezone"] = "Tokyo"
|
38
|
+
time = Time.gm 2004
|
39
|
+
|
40
|
+
tokyo_time = @obj.adjust_time time
|
41
|
+
offset = 9.hours # Tokyo is at +9:00
|
42
|
+
assert_equal offset, tokyo_time - time
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|