radiant 0.5.0

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.

Files changed (205) hide show
  1. data/CHANGELOG +1 -0
  2. data/CONTRIBUTORS +12 -0
  3. data/LICENSE +9 -0
  4. data/README +91 -0
  5. data/Rakefile +10 -0
  6. data/app/behaviors/archive_behavior.rb +42 -0
  7. data/app/behaviors/archive_day_index_behavior.rb +30 -0
  8. data/app/behaviors/archive_month_index_behavior.rb +30 -0
  9. data/app/behaviors/archive_year_index_behavior.rb +30 -0
  10. data/app/behaviors/env_behavior.rb +18 -0
  11. data/app/behaviors/page_missing_behavior.rb +31 -0
  12. data/app/controllers/admin/export_controller.rb +8 -0
  13. data/app/controllers/admin/layout_controller.rb +23 -0
  14. data/app/controllers/admin/model_controller.rb +119 -0
  15. data/app/controllers/admin/page_controller.rb +119 -0
  16. data/app/controllers/admin/snippet_controller.rb +6 -0
  17. data/app/controllers/admin/user_controller.rb +45 -0
  18. data/app/controllers/admin/welcome_controller.rb +39 -0
  19. data/app/controllers/application.rb +32 -0
  20. data/app/controllers/site_controller.rb +54 -0
  21. data/app/filters/markdown_filter.rb +9 -0
  22. data/app/filters/textile_filter.rb +9 -0
  23. data/app/helpers/admin/export_helper.rb +2 -0
  24. data/app/helpers/admin/layout_helper.rb +2 -0
  25. data/app/helpers/admin/page_helper.rb +10 -0
  26. data/app/helpers/admin/snippet_helper.rb +2 -0
  27. data/app/helpers/admin/user_helper.rb +2 -0
  28. data/app/helpers/admin/welcome_helper.rb +2 -0
  29. data/app/helpers/application_helper.rb +141 -0
  30. data/app/helpers/site_helper.rb +2 -0
  31. data/app/models/archive_finder.rb +66 -0
  32. data/app/models/behavior.rb +194 -0
  33. data/app/models/layout.rb +13 -0
  34. data/app/models/page.rb +91 -0
  35. data/app/models/page_context.rb +526 -0
  36. data/app/models/page_part.rb +13 -0
  37. data/app/models/radiant/config.rb +53 -0
  38. data/app/models/radiant/exporter.rb +11 -0
  39. data/app/models/response_cache.rb +112 -0
  40. data/app/models/snippet.rb +16 -0
  41. data/app/models/status.rb +31 -0
  42. data/app/models/text_filter.rb +11 -0
  43. data/app/models/user.rb +70 -0
  44. data/app/models/user_action_observer.rb +13 -0
  45. data/app/views/admin/layout/index.rhtml +38 -0
  46. data/app/views/admin/layout/new.rhtml +37 -0
  47. data/app/views/admin/layout/remove.rhtml +17 -0
  48. data/app/views/admin/page/_node.rhtml +51 -0
  49. data/app/views/admin/page/_part.rhtml +17 -0
  50. data/app/views/admin/page/children.rhtml +4 -0
  51. data/app/views/admin/page/index.rhtml +172 -0
  52. data/app/views/admin/page/new.rhtml +164 -0
  53. data/app/views/admin/page/remove.rhtml +14 -0
  54. data/app/views/admin/snippet/index.rhtml +36 -0
  55. data/app/views/admin/snippet/new.rhtml +28 -0
  56. data/app/views/admin/snippet/remove.rhtml +16 -0
  57. data/app/views/admin/user/index.rhtml +43 -0
  58. data/app/views/admin/user/new.rhtml +48 -0
  59. data/app/views/admin/user/preferences.rhtml +29 -0
  60. data/app/views/admin/user/remove.rhtml +16 -0
  61. data/app/views/admin/welcome/login.rhtml +51 -0
  62. data/app/views/layouts/application.rhtml +75 -0
  63. data/app/views/site/not_found.rhtml +3 -0
  64. data/bin/radiant +305 -0
  65. data/config/boot.rb +80 -0
  66. data/config/database.mysql.yml +20 -0
  67. data/config/database.postgresql.yml +20 -0
  68. data/config/database.sqlite.yml +20 -0
  69. data/config/environment.rb +76 -0
  70. data/config/environments/development.rb +20 -0
  71. data/config/environments/production.rb +22 -0
  72. data/config/environments/test.rb +20 -0
  73. data/config/locomotive.yml +6 -0
  74. data/config/routes.rb +64 -0
  75. data/db/development_structure.sql +80 -0
  76. data/db/migrate/001_create_radiant_tables.rb +73 -0
  77. data/db/migrate/002_insert_initial_data.rb +45 -0
  78. data/db/migrate/003_rename_behavior_column.rb +9 -0
  79. data/db/migrate/004_rename_filter_column.rb +11 -0
  80. data/db/migrate/005_add_virtual_column_to_page.rb +9 -0
  81. data/db/migrate/006_integer_columns_to_boolean.rb +11 -0
  82. data/db/migrate/007_remove_virtual_column_from_page.rb +9 -0
  83. data/db/migrate/008_add_virtual_column_to_page_again.rb +9 -0
  84. data/db/migrate/009_add_content_type_field_to_layout.rb +9 -0
  85. data/db/schema.rb +74 -0
  86. data/db/templates/empty.yml +2 -0
  87. data/db/templates/simple-blog.yml +197 -0
  88. data/db/templates/styled-blog.yml +472 -0
  89. data/lib/advanced_delegation.rb +21 -0
  90. data/lib/archive_index_behavior_tags_and_methods.rb +48 -0
  91. data/lib/generators/behavior/USAGE +16 -0
  92. data/lib/generators/behavior/behavior_generator.rb +22 -0
  93. data/lib/generators/behavior/templates/model.rb.template +9 -0
  94. data/lib/generators/behavior/templates/unit_test.rb.template +16 -0
  95. data/lib/generators/filter/USAGE +16 -0
  96. data/lib/generators/filter/filter_generator.rb +22 -0
  97. data/lib/generators/filter/templates/model.rb.template +8 -0
  98. data/lib/generators/filter/templates/unit_test.rb.template +7 -0
  99. data/lib/inheritable_class_attributes.rb +65 -0
  100. data/lib/login_system.rb +80 -0
  101. data/lib/plugins/index_quoting_fix/init.rb +32 -0
  102. data/lib/plugins/string_io/init.rb +2 -0
  103. data/lib/radiant.rb +5 -0
  104. data/lib/registerable.rb +70 -0
  105. data/lib/tasks/release.rake +84 -0
  106. data/public/404.html +8 -0
  107. data/public/500.html +8 -0
  108. data/public/dispatch.cgi +10 -0
  109. data/public/dispatch.fcgi +24 -0
  110. data/public/dispatch.rb +10 -0
  111. data/public/favicon.ico +0 -0
  112. data/public/images/add-child.png +0 -0
  113. data/public/images/brown-bottom-line.gif +0 -0
  114. data/public/images/clear-page-cache.png +0 -0
  115. data/public/images/collapse.png +0 -0
  116. data/public/images/expand.png +0 -0
  117. data/public/images/minus.png +0 -0
  118. data/public/images/new-homepage.png +0 -0
  119. data/public/images/new-layout.png +0 -0
  120. data/public/images/new-snippet.png +0 -0
  121. data/public/images/new-user.png +0 -0
  122. data/public/images/page.png +0 -0
  123. data/public/images/plus.png +0 -0
  124. data/public/images/remove-disabled.png +0 -0
  125. data/public/images/remove.png +0 -0
  126. data/public/images/snippet.png +0 -0
  127. data/public/images/spinner.gif +0 -0
  128. data/public/images/view-site.gif +0 -0
  129. data/public/images/virtual-page.png +0 -0
  130. data/public/javascripts/application.js +2 -0
  131. data/public/javascripts/controls.js +815 -0
  132. data/public/javascripts/dragdrop.js +913 -0
  133. data/public/javascripts/effects.js +958 -0
  134. data/public/javascripts/pngfix.js +78 -0
  135. data/public/javascripts/prototype.js +2006 -0
  136. data/public/javascripts/ruledtable.js +28 -0
  137. data/public/javascripts/string.js +23 -0
  138. data/public/javascripts/tabcontrol.js +140 -0
  139. data/public/robots.txt +1 -0
  140. data/public/stylesheets/admin.css +464 -0
  141. data/script/about +3 -0
  142. data/script/breakpointer +3 -0
  143. data/script/console +3 -0
  144. data/script/destroy +3 -0
  145. data/script/generate +3 -0
  146. data/script/performance/benchmarker +3 -0
  147. data/script/performance/profiler +3 -0
  148. data/script/plugin +3 -0
  149. data/script/process/reaper +3 -0
  150. data/script/process/spawner +3 -0
  151. data/script/process/spinner +3 -0
  152. data/script/runner +3 -0
  153. data/script/server +3 -0
  154. data/script/setup_database +297 -0
  155. data/test/fixtures/layouts.yml +26 -0
  156. data/test/fixtures/page_parts.yml +99 -0
  157. data/test/fixtures/pages.yml +359 -0
  158. data/test/fixtures/pages.yml.rej +28 -0
  159. data/test/fixtures/snippets.yml +18 -0
  160. data/test/fixtures/users.yml +30 -0
  161. data/test/functional/admin/export_controller_test.rb +22 -0
  162. data/test/functional/admin/layout_controller_test.rb +40 -0
  163. data/test/functional/admin/model_controller_test.rb +152 -0
  164. data/test/functional/admin/page_controller_test.rb +179 -0
  165. data/test/functional/admin/snippet_controller_test.rb +11 -0
  166. data/test/functional/admin/user_controller_test.rb +71 -0
  167. data/test/functional/admin/welcome_controller_test.rb +48 -0
  168. data/test/functional/application_controller_test.rb +44 -0
  169. data/test/functional/login_system_test.rb +155 -0
  170. data/test/functional/site_controller_test.rb +172 -0
  171. data/test/helpers/archive_index_test_helper.rb +35 -0
  172. data/test/helpers/behavior_render_test_helper.rb +34 -0
  173. data/test/helpers/behavior_test_helper.rb +47 -0
  174. data/test/helpers/caching_test_helper.rb +41 -0
  175. data/test/helpers/layout_test_helper.rb +35 -0
  176. data/test/helpers/page_part_test_helper.rb +49 -0
  177. data/test/helpers/page_test_helper.rb +36 -0
  178. data/test/helpers/snippet_test_helper.rb +32 -0
  179. data/test/helpers/user_test_helper.rb +34 -0
  180. data/test/helpers/validation_test_helper.rb +42 -0
  181. data/test/test_helper.rb +54 -0
  182. data/test/unit/behavior_test.rb +196 -0
  183. data/test/unit/behaviors/archive_behavior_test.rb +33 -0
  184. data/test/unit/behaviors/archive_day_index_behavior_test.rb +21 -0
  185. data/test/unit/behaviors/archive_month_index_behavior_test.rb +21 -0
  186. data/test/unit/behaviors/archive_year_index_behavior_test.rb +21 -0
  187. data/test/unit/behaviors/page_missing_behavior_test.rb +27 -0
  188. data/test/unit/filters/markdown_filter_test.rb +14 -0
  189. data/test/unit/filters/textile_filter_test.rb +14 -0
  190. data/test/unit/inheritable_class_attributes_test.rb +47 -0
  191. data/test/unit/layout_test.rb +29 -0
  192. data/test/unit/page_context_test.rb +375 -0
  193. data/test/unit/page_context_test.rb.rej +26 -0
  194. data/test/unit/page_part_test.rb +44 -0
  195. data/test/unit/page_test.rb +224 -0
  196. data/test/unit/radiant/config_test.rb +46 -0
  197. data/test/unit/radiant/exporter_test.rb +26 -0
  198. data/test/unit/registerable_test.rb +68 -0
  199. data/test/unit/response_cache_test.rb +133 -0
  200. data/test/unit/snippet_test.rb +47 -0
  201. data/test/unit/status_test.rb +43 -0
  202. data/test/unit/text_filter_test.rb +14 -0
  203. data/test/unit/user_action_observer_test.rb +40 -0
  204. data/test/unit/user_test.rb +138 -0
  205. metadata +355 -0
@@ -0,0 +1,359 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+ homepage:
3
+ id: 1
4
+ title: Ruby Home Page
5
+ breadcrumb: Home
6
+ slug: /
7
+ status_id: 100
8
+ parent_id:
9
+ published_at: 2006-01-30 08:41:07 -05:00
10
+ documentation:
11
+ id: 2
12
+ title: Documentation
13
+ breadcrumb: Documentation
14
+ slug: documentation
15
+ status_id: 100
16
+ parent_id: 1
17
+ published_at: 2006-01-30 08:41:07 -05:00
18
+ books:
19
+ id: 3
20
+ title: Books
21
+ breadcrumb: Books
22
+ slug: books
23
+ status_id: 100
24
+ parent_id: 2
25
+ published_at: 2006-01-30 08:41:07 -05:00
26
+ textile:
27
+ id: 4
28
+ title: Textile
29
+ breadcrumb: Textile
30
+ slug: textile
31
+ status_id: 100
32
+ parent_id: 1
33
+ published_at: 2006-01-30 08:41:07 -05:00
34
+ radius:
35
+ id: 5
36
+ title: Radius Test Page
37
+ breadcrumb: Radius Test Page
38
+ slug: radius
39
+ status_id: 100
40
+ parent_id: 1
41
+ created_by: 3
42
+ published_at: 2006-01-30 08:41:07 -05:00
43
+ <% for i in 1..3 %>
44
+ radius_child_<%= i %>:
45
+ id: <%= 5 + i %>
46
+ title: Radius Test Child <%= i %>
47
+ breadcrumb: Radius Test Child <%= i %>
48
+ slug: child-<%= i %>
49
+ status_id: 100
50
+ parent_id: 5
51
+ created_by: 1
52
+ published_at: 2006-01-30 08:41:07 -05:00
53
+ <% end %>
54
+ page_with_layout:
55
+ id: 9
56
+ title: Page With Layout
57
+ breadcrumb: Page With Layout
58
+ slug: page-with-layout
59
+ status_id: 100
60
+ layout_id: 1
61
+ parent_id: 1
62
+ published_at: 2006-01-30 08:41:07 -05:00
63
+ another_page_with_layout:
64
+ id: 52
65
+ title: Another Page With Layout
66
+ breadcrumb: Another Page With Layout
67
+ slug: another-page-with-layout
68
+ status_id: 100
69
+ layout_id: 1
70
+ parent_id: 1
71
+ published_at: 2006-01-30 08:41:07 -05:00
72
+ child_of_page_with_layout:
73
+ id: 18
74
+ title: Child of Page With Layout
75
+ breadcrumb: Child of Page With Layout
76
+ slug: child-of-page-with-layout
77
+ status_id: 100
78
+ parent_id: 9
79
+ published_at: 2006-01-30 08:47:07 -05:00
80
+ parent:
81
+ id: 10
82
+ title: Parent
83
+ breadcrumb: Parent
84
+ slug: parent
85
+ status_id: 100
86
+ parent_id: 1
87
+ published_at: 2006-01-30 08:41:07 -05:00
88
+ child:
89
+ id: 11
90
+ title: Child
91
+ breadcrumb: Child
92
+ slug: child
93
+ status_id: 100
94
+ parent_id: 10
95
+ published_at: 2006-01-30 08:41:07 -05:00
96
+ archive:
97
+ id: 12
98
+ title: Archive
99
+ breadcrumb: Parent
100
+ slug: archive
101
+ behavior_id: Archive
102
+ status_id: 100
103
+ parent_id: 1
104
+ published_at: 2006-01-30 08:41:07 -05:00
105
+ year_index:
106
+ id: 41
107
+ title: %Y Archive
108
+ slug: year
109
+ behavior_id: Archive Year Index
110
+ status_id: 101
111
+ parent_id: 12
112
+ virtual: true
113
+ published_at: 2006-02-05 08:44:07 -05:00
114
+ month_index:
115
+ id: 42
116
+ title: %B %Y Archive
117
+ slug: month
118
+ behavior_id: Archive Month Index
119
+ status_id: 101
120
+ parent_id: 12
121
+ virtual: true
122
+ published_at: 2006-02-05 08:44:07 -05:00
123
+ day_index:
124
+ id: 43
125
+ title: %B %d, %Y Archive
126
+ slug: day
127
+ behavior_id: Archive Day Index
128
+ status_id: 101
129
+ parent_id: 12
130
+ virtual: true
131
+ published_at: 2006-02-05 08:44:07 -05:00
132
+ article:
133
+ id: 13
134
+ title: Article
135
+ breadcrumb: Article
136
+ slug: article
137
+ status_id: 100
138
+ parent_id: 12
139
+ published_at: 2000-05-01 08:41:07 -05:00
140
+ article2:
141
+ id: 14
142
+ title: Article Two
143
+ breadcrumb: Article Two
144
+ slug: article-2
145
+ status_id: 100
146
+ parent_id: 12
147
+ published_at: 2000-06-09 08:42:04 -05:00
148
+ article3:
149
+ id: 44
150
+ title: Article Three
151
+ breadcrumb: Article Three
152
+ slug: article-3
153
+ status_id: 100
154
+ parent_id: 12
155
+ published_at: 2000-06-10 12:02:43 -05:00
156
+ article4:
157
+ id: 45
158
+ title: Article Four
159
+ breadcrumb: Article Four
160
+ slug: article-4
161
+ status_id: 100
162
+ parent_id: 12
163
+ published_at: 2000-08-06 03:32:31 -05:00
164
+ article5:
165
+ id: 46
166
+ title: Article Five
167
+ breadcrumb: Article Five
168
+ slug: article-5
169
+ status_id: 100
170
+ parent_id: 12
171
+ published_at: 2001-08-06 03:32:31 -05:00
172
+ article_draft:
173
+ id: 53
174
+ title: Draft Article
175
+ breadcrumb: Draft Article
176
+ slug: draft
177
+ status_id: 1
178
+ parent_id: 12
179
+ draft:
180
+ id: 15
181
+ title: Draft Page
182
+ breadcrumb: Draft Page
183
+ slug: draft
184
+ status_id: 1
185
+ parent_id: 1
186
+ hidden:
187
+ id: 16
188
+ title: Hidden Page
189
+ breadcrumb: Hidden Page
190
+ slug: hidden
191
+ status_id: 101
192
+ parent_id: 1
193
+ no_cache:
194
+ id: 17
195
+ title: No Cache
196
+ breadcrumb: No Cache
197
+ slug: no-cache
198
+ status_id: 100
199
+ parent_id: 1
200
+ behavior_id: No Cache
201
+ assorted:
202
+ id: 19
203
+ title: Assorted Root
204
+ breadcrumb: No Cache
205
+ slug: assorted
206
+ status_id: 100
207
+ parent_id: 1
208
+ <% for i in 1..10 %>
209
+ assorted<%= i %>:
210
+ id: <%= 19 + i %>
211
+ title: Assorted <%= i %>
212
+ breadcrumb: <%= (i + 5) % 10 %>
213
+ slug: <%= (?a + (10 - i)).chr %>
214
+ status_id: 100
215
+ parent_id: 19
216
+ published_at: 2000-06-10 07:<%= '%02d' % (17 - i) %>:<%= '%02d' % (i + 11) %> -05:00
217
+ <% end %>
218
+ assorted-draft:
219
+ id: 40
220
+ title: Draft
221
+ breadcrumb: Draft
222
+ slug: draft
223
+ status_id: 1
224
+ parent_id: 19
225
+ news:
226
+ id: 30
227
+ title: News Archives
228
+ breadcrumb: news
229
+ slug: news
230
+ status_id: 100
231
+ parent_id: 1
232
+ published_at: 2006-01-30 08:41:07 -05:00
233
+ news_child_published:
234
+ id: 31
235
+ title: A Great Day for Ruby
236
+ breadcrumb: news
237
+ slug: a-great-day-for-ruby
238
+ status_id: 100
239
+ parent_id: 30
240
+ published_at: 2006-01-30 08:41:07 -05:00
241
+ news_child_published_2:
242
+ id: 32
243
+ title: Another Great Day for Ruby
244
+ breadcrumb: news
245
+ slug: another-great-day-for-ruby
246
+ status_id: 100
247
+ parent_id: 30
248
+ published_at: 2006-02-05 08:44:07 -05:00
249
+ grandchild:
250
+ id: 33
251
+ title: Grandchild
252
+ breadcrumb: Grandchild
253
+ slug: grandchild
254
+ status_id: 100
255
+ parent_id: 11
256
+ published_at: 2006-02-05 08:44:07 -05:00
257
+ great_grandchild:
258
+ id: 34
259
+ title: Great-Grandchild
260
+ slug: great-grandchild
261
+ status_id: 100
262
+ parent_id: 33
263
+ published_at: 2006-02-05 08:44:07 -05:00
264
+ custom_tags:
265
+ id: 35
266
+ title: Custom Tags
267
+ slug: custom-tags
268
+ behavior_id: Test Behavior
269
+ status_id: 100
270
+ parent_id: 1
271
+ published_at: 2006-02-05 08:44:07 -05:00
272
+ custom_tags_child:
273
+ id: 36
274
+ title: Custom Tags Child
275
+ slug: child
276
+ status_id: 100
277
+ parent_id: 35
278
+ published_at: 2006-02-05 08:44:07 -05:00
279
+ page_with_yaml_config:
280
+ id: 37
281
+ title: Page with YAML config
282
+ slug: page-with-yaml-config
283
+ status_id: 100
284
+ parent_id: 1
285
+ published_at: 2006-02-05 08:44:07 -05:00
286
+ small_test:
287
+ id: 38
288
+ title: Small Test
289
+ slug: small-test
290
+ status_id: 100
291
+ parent_id: 1
292
+ published_at: 2006-02-05 08:44:07 -05:00
293
+ inheritance_test_page:
294
+ id: 47
295
+ title: Inheritance Test Page
296
+ slug: inheritance-test-page
297
+ status_id: 100
298
+ parent_id: 1
299
+ published_at: 2006-02-05 08:44:07 -05:00
300
+ inheritance_test_page_child:
301
+ id: 48
302
+ title: Inheritance Test Page Child
303
+ slug: child
304
+ status_id: 100
305
+ parent_id: 47
306
+ published_at: 2006-02-05 08:44:07 -05:00
307
+ inheritance_test_page_grandchild:
308
+ id: 49
309
+ title: Inheritance Test Page Grandchild
310
+ slug: grandchild
311
+ status_id: 100
312
+ parent_id: 48
313
+ published_at: 2006-02-05 08:44:07 -05:00
314
+ gallery:
315
+ id: 50
316
+ title: Gallery
317
+ slug: gallery
318
+ status_id: 100
319
+ parent_id: 1
320
+ published_at: 2006-02-05 08:44:07 -05:00
321
+ missing:
322
+ id: 51
323
+ title: File Not Found
324
+ slug: missing
325
+ behavior_id: Page Missing
326
+ status_id: 100
327
+ parent_id: 50
328
+ published_at: 2006-02-05 08:44:07 -05:00
329
+ page_with_content_type_set_on_layout:
330
+ id: 54
331
+ title: Page With Content Type Set On Layout
332
+ slug: page_with_content_type_set_on_layout
333
+ status_id: 100
334
+ layout_id: 2
335
+ parent_id: 1
336
+ published_at: 2006-02-05 08:44:07 -05:00
337
+ deep_nested_child_for_breadcrumbs:
338
+ id: 55
339
+ title: Deeply nested child for testing breadcrumbs
340
+ slug: deep-nested-child
341
+ breadcrumb: Deeply nested child
342
+ status_id: 100
343
+ parent_id: 6
344
+ published_at: 2006-02-05 08:44:07 -05:00
345
+ homepage_draft:
346
+ id: 56
347
+ title: Home Page Draft
348
+ breadcrumb: Home Page Draft
349
+ slug: homepage_draft
350
+ status_id: 1
351
+ parent_id: 1
352
+ published_at: 2006-01-30 08:41:07 -05:00
353
+ gallery_draft:
354
+ id: 57
355
+ title: Gallery Draft
356
+ slug: gallery_draft
357
+ status_id: 1
358
+ parent_id: 50
359
+ published_at: 2006-02-05 08:44:07 -05:00
@@ -0,0 +1,28 @@
1
+ ***************
2
+ *** 333,336 ****
3
+ status_id: 100
4
+ layout_id: 2
5
+ parent_id: 1
6
+ - published_at: 2006-02-05 08:44:07 -05:00--- 333,354 ----
7
+ status_id: 100
8
+ layout_id: 2
9
+ parent_id: 1
10
+ + published_at: 2006-02-05 08:44:07 -05:00
11
+ + tags:
12
+ + id: 55
13
+ + title: Tags
14
+ + breadcrumb: Tags
15
+ + slug: tags
16
+ + behavior_id: Tag Display
17
+ + status_id: 100
18
+ + parent_id:
19
+ + published_at: 2006-01-30 08:41:07 -05:00
20
+ + tags_listing:
21
+ + id: 56
22
+ + title: Tagged
23
+ + breadcrumb: Tagged
24
+ + slug: tagged
25
+ + behavior_id: Tag Listing
26
+ + status_id: 100
27
+ + parent_id: 55
28
+ + published_at: 2006-01-30 08:41:07 -05:00
@@ -0,0 +1,18 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+ first:
3
+ id: 1
4
+ name: first
5
+ content: test
6
+ another:
7
+ id: 2
8
+ name: another
9
+ content: another test
10
+ markdown:
11
+ id: 3
12
+ name: markdown
13
+ content: **markdown**
14
+ filter_id: Markdown
15
+ snippet_with_tag:
16
+ id: 4
17
+ name: snippet_with_tag
18
+ content: <r:page:title />
@@ -0,0 +1,30 @@
1
+ # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
+ existing:
3
+ id: 1
4
+ name: Existing User
5
+ login: existing
6
+ password: <%= User.sha1 'password' %>
7
+ email: existing.user@gmail.com
8
+ another:
9
+ id: 2
10
+ name: Another User
11
+ login: another
12
+ password: <%= User.sha1 'password' %>
13
+ admin:
14
+ id: 3
15
+ name: Admin User
16
+ login: admin
17
+ password: <%= User.sha1 'password' %>
18
+ admin: true
19
+ developer:
20
+ id: 4
21
+ name: Developer User
22
+ login: developer
23
+ password: <%= User.sha1 'password' %>
24
+ developer: true
25
+ non_admin:
26
+ id: 5
27
+ name: Non-Admin User
28
+ login: non-admin
29
+ password: <%= User.sha1 'password' %>
30
+ admin: false
@@ -0,0 +1,22 @@
1
+ require File.dirname(__FILE__) + '/../../test_helper'
2
+ require 'admin/export_controller'
3
+
4
+ # Re-raise errors caught by the controller.
5
+ class Admin::ExportController; def rescue_action(e) raise e end; end
6
+
7
+ class Admin::ExportControllerTest < Test::Unit::TestCase
8
+ fixtures :users, :pages
9
+
10
+ def setup
11
+ @controller = ExportController.new
12
+ @request = ActionController::TestRequest.new
13
+ @response = ActionController::TestResponse.new
14
+ @request.session[:user] = users(:developer)
15
+ end
16
+
17
+ def test_yaml
18
+ get :yaml
19
+ assert_kind_of Hash, YAML.load(@response.body)
20
+ assert_equal 'text/yaml', @response.headers['Content-Type']
21
+ end
22
+ end